Reply to Re: strings and conditionals..

Your name:

Reply:


Posted by ImOk on 06/12/06 03:07

You can also use

// Does string contain xyz?
if ( ($spos=strpos("abcxyz","xyz")) >0 ) {
... do code ...
}


maya wrote:
> hi, am new to PHP, trying to learn strings... I'm a bit mystifed about
> something.. how do you test for conditions in strings? for example,
> how would you do what in JavaScript (or Java) you do like this
>
> if (email.indexOf('@') != -1) { // etc..
>
> also how do you test for length of a string? I tried:
>
> if (strlen($myName) == 7) {
>
> but got error...
>
> I have looked at sections dealing with conditionals in tutorials, but
> don't see examles of this (also don't see functions like indexOf(),
> etc.. under Strings here, http://us2.php.net/manual/en/ref.strings.php..
>
> thank you very much..

[Back to original 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

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