Hi Sandeep,

<?
if (preg_match(/"@monkeys.com/i", $variable)) {
    echo "Got some monkeys.";
} else {
    echo "No monkeys here.";
}
?>

preg_match();
ereg();
eregi();

Will all help you.

James.

"Sandeep Hundal" <[EMAIL PROTECTED]> wrote in message
A0A5617A0A05D5118EBD00508B8B953B5EA932@PROF-X">news:A0A5617A0A05D5118EBD00508B8B953B5EA932@PROF-X...
> hi all!
>
> i need to see if a $variable has a piece of text included in it. how do i
do
> that?
>
> i need to do something like:
>
> if ($variable =matches= "@monkeys.com") { then do this}
>
> tia!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to