Posted by Malcolm Dew-Jones on 11/14/45 11:27
monomaniac21 (marcrice20@msn.com) wrote:
: Hi guys!
: Can anyone tell me how you can perform validation on a string variable
: in PHP so that you can check if a specific character is contained
: within the string. The reason for this is i am trying to create a form
: for a site i am making and i want to validate the user's input for the
: email address field, by ensuring it contains the '@' character.
That is hardly a check to validate an email address!
However, one function that would help is strstr();
$at = strstr($claimed_email_address,"@");
if ($at == "")
{
echo "no @ found";
die ;
}
But there are dozens of other functions that would also help. The php
manual is available on line (google for it) look for string functions.
--
This programmer available for rent.
Navigation:
[Reply to this message]
|