Practicas de "Desarrollo Web en Entorno Servidor" de 2º CFGS en Desarrollo de Aplicaciones Web Bilingüe (DAW).
- 1- Some exercises to practice Arrays in PHP.
-
1- Make a PHP page where you enter two words in two variables and say if they rhyme or not. If the last three letters match, you have to say that they rhyme. If they coincide only the last two have to say that they rhyme a bit and if not, they do not rhyme. Remember that words will rhyme regardless of whether they are written in uppercase or lowercase.
-
2- Make a PHP page that allows you to check if a valid email address is entered in a text box. A valid email address must have the characters '@' and '.' If the address is valid write on one side the username and on the other the domain of that address.
-
3- Sometimes we have to check the validity of a string of characters to see if it contains only those that we consider to be valid. For example, if we had to validate the previous username, we could allow numbers, letters and occasionally '-' or '_' characters, but not other characters like '' + ',' @ ',', ', etc. . Also, being a username, we can have a maximum and minimum number of characters set. Perform a check for the user name with two parts, the first to see if the length of the string is allowed (between 3 and 20 characters) and the second to ensure that the characters used are among those allowed (letters, numbers, hyphen high, low script).