RE: [PHP] comparing a string

2006-06-20 Thread yangshiqi1089
When the $_REQUEST['x'] is not 0 or '', it will be always correct condition
of your if. see the magic*.

-Original Message-
From: tedd [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 20, 2006 10:02 PM
To: Ross; php-general@lists.php.net
Subject: Re: [PHP] comparing a string

At 12:43 PM +0100 6/20/06, Ross wrote:
>I have a quiz where the ansers are held in a array called $correct answers.
>When I compare the string
>
>if  ($_REQUEST['x']= $correct_answers[$page-1]) {
>
>
>
>with a double == the answer is always correct with the single = it is
always
>wrong.
>
>when I echo out the posted answer and the value from the answers arrray
they
>are correct.

When you say == the answer is always correct -- does that mean even when the
answer is wrong? If so, then there's something else going on here.

But, I believe the answer is:

if  ($_REQUEST['x'] == $correct_answers[$page-1]) {

This will compare the two and if they are the same will report true. You
should read the manual.

hth's

tedd

-- 


http://sperling.com  http://ancientstones.com  http://earthstones.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] editor

2005-10-16 Thread yangshiqi1089
It's also could be vim.

-Original Message-
From: Hodicska Gergely [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 15, 2005 9:48 PM
To: php general help
Subject: Re: [PHP] editor

>> I read somewhere about an editor, which has built in support for
>> phpdocumentator and creating unit test. Now I could not find it, I tried
>> a lot using Google without success.

> Could it be PHPEdit ?

Yes, thx, this is the editor which I tried to find. I already get it 
last night, after I tried to google not "php editor unit test support", 
but only "php editor simpletest".


Regards,
Felhő

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php