Stumped on this one. I simply want to test the length of a string that comes from a cookie and then act on it based on the content of the first three characters.
the code
$thecookie = $_COOKIE["testRE"];
echo "<br>the cookie is = ", $thecookie;
if($thecookie = null) {$thecookie == "V85";} #In case cookies are turned off
$testlenth = strlen($thecookie);
echo "<br> The test length is = " , $testlenth;
$cooklen = strlen($thecookie);
echo "<br>the cookie length is = ", $cooklen;
$strtest = substr($thecookie,0,3);
the output I am getting is
the cookie is = V853
The test length is = 0
the cookie length is = 0
the FIRST THREE CHARACTERS ARE =
I would have expected a test length of 4 and a cookie length of 4 and the first three characters to be = to V85 which I could then process as a certain class of visitor. Any ideas?