You are here: Re: How to check if a character appears in a form variable? « PHP Programming Language « IT news, forums, messages
Re: How to check if a character appears in a form variable?

Posted by Malcolm Dew-Jones on 10/17/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация