strings and conditionals..
- From: maya <maya778899@xxxxxxxxx>
- Date: Sun, 11 Jun 2006 15:52:55 -0400
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..
.
- Follow-Ups:
- Re: strings and conditionals..
- From: Mladen Gogala
- Re: strings and conditionals..
- From: ImOk
- Re: strings and conditionals..
- From: Toby Inkster
- Re: strings and conditionals..
- From: Janwillem Borleffs
- Re: strings and conditionals..
- Prev by Date: Re: mail function
- Next by Date: Re: mail function
- Previous by thread: File manager
- Next by thread: Re: strings and conditionals..
- Index(es):
Relevant Pages
|