You are here: Re: compare strings? « PHP Language « IT news, forums, messages
Re: compare strings?

Posted by Exyle on 06/15/05 04:09

the eregi function should be what you're looking for.

eregi($buffer, $email)

if $email contains $buffer than it will return true. You can also use
regular expressions. eregi is case insensitive (eg it will interpret 'A'
and 'a' as the same thing). the ereg function does the same thing only
it's case sensative.

Ron Eggler @ work wrote:
> Hi,
>
> I want to compare two Strings and I don't know how. Following HTML-Output is
> the result of the below code. why?
> The Strings are the same but the if() is false, why? Thank you!
> [HTML]
> Scofieldada@softhome.net
> <br>
> Scofieldada@softhome.net was passed<br>
> not yet!<br>
> [/HTML]
> [PHP]
> echo $buffer."<br>\n";
> echo $email." was passed<br>\n";
> if ($buffer==$email)
> {
> echo "string already exists!<br>\n";
> return true;
> }
> else
> {
> echo "not yet!<br>\n";
> }
> [/PHP]
>
>

 

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

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