Re: Re: comparing strings - again!

From: Date: Tue, 20 Jun 2006 15:09:29 +0000
Subject: Re: Re: comparing strings - again!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-238404@lists.php.net to get a copy of this message
var_dump gives Company Director string(17) Company Director string(16) Why would they be different? Seems like they have add some extra whitespace? R. ----- Original Message ----- From: "Jochem Maas" <jochem@iamjochem.com> To: "Ross" <ross@aztechost.com> Cc: <php-general@lists.php.net> Sent: Tuesday, June 20, 2006 3:57 PM Subject: Re: [PHP] Re: comparing strings - again!
Ross wrote:
This does not work although when I echo out the strings they are exactly the same. Strange!
try using var_dump($compare1, $compare2);
"Ross" <ross@aztechost.com> wrote in message news:...
if (isset($_POST['Submit'])) {
//echo "post equals".$_POST['x']."     corect
is".$correct_answers[$page-1]; $compare1 = $_POST['x']; echo "page is".$page; $compare2 = $correct_answers[($page-1)]; echo "compare1 is ".$compare1; echo "<BR>"; echo "compare2 is ".$compare2; if (strcmp($compare1, $compare2) == 0) { $incrementedPage = $page + 1; ?> <script type="text/javascript"> <!-- window.location = "http://www.google.com/" //--> </script> <? //header("Location: evaluation.php?page=$incrementedPage"); } else { $chances++; echo "you have had".$chances; } } ?>


« previous php.general (#238404) next »