if (ereg(john,$jeff) ) { }
ok
or:
if( strstr( $jeff, john) ) { }
ok
or:
if( strpos( $jeff, john) ) { }
error
if (strpos($jeff, john) !== FALSE)
Best regards,
Andrey Hristov
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PROTECTED]
Subject: Re: [PHP] comparisons
if (ereg(john,$jeff) ) { }
ok
or:
if( strstr( $jeff, john) ) { }
ok
or:
if( strpos( $jeff, john) ) { }
error
if (strpos($jeff, john) !== FALSE)
Best regards,
Andrey Hristov
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
PM
Subject: RE: [PHP] comparisons
Andrey, you are incorrect.
From the manual on strpos():
int strpos (string haystack, string needle [, int offset])
If needle is not found, returns FALSE.
-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22
ahhhinteresting.
thank you for the clarification
I stand humbled, head bowed...
rick
-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 8:03 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] comparisons
From the docs :
Note
]
Subject: [PHP] comparisons
Hello,
I'm having a rather strange problem. I'm trying to compare two values.
"01" and "1". The variables names that they are submitted under are pick1
and pick2. i use the following code
$mypick1 = strval($pick1);
$mypick2 = strval($pic
On Monday 12 February 2001 10:41, PHPBeginner.com wrote:
I'm having a rather strange problem. I'm trying to compare two
values. "01" and "1". The variables names that they are submitted
under are pick1 and pick2. i use the following code
[...]
I still get the error. Anyone have any
Hello,
I'm having a rather strange problem. I'm trying to compare two values. "01" and
"1". The variables names that they are submitted under are pick1 and pick2. i use
the following code
$mypick1 = strval($pick1);
$mypick2 = strval($pick2);
I then perform the following comparison:
if
if equal.
Cheers
Reply Header
Subject:[PHP] comparisons
Author: "Curtis Maurand" [EMAIL PROTECTED]
Date:Sun, 11 Feb 2001 18:47:31 +
Hello,
I'm having a rather strange problem. I'm trying to compare two values. &q
: "Phil Driscoll" [EMAIL PROTECTED]
To: "Curtis Maurand" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 2:34 PM
Subject: Re: [PHP] comparisons
In spite of yor best efforts here, PHP converts the string values to
numbers (because the strings look like n
Can I also write that like the following?
if (strcmp($pick1,$pick2) == 0)
{
perform some action;
}
that will work, but I prefer
Can I also write that like the following?
if (!strcmp($pick1,$pick2))
{
perform some action;
}
Cheers
Phil
--
PHP General Mailing List
that will work, but I prefer
Can I also write that like the following?
if (!strcmp($pick1,$pick2))
{
perform some action;
}
Thanks. That works for me.
Curtis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
11 matches
Mail list logo