Data Types Problem
| From: | Arno Coetzee | Date: | Mon, 12 Mar 2007 07:26:13 +0000 |
| Subject: | Data Types Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-250269@lists.php.net to get a copy of this message | ||
Hi Guys
I seem to have a problem with data types in php
when executing the following script , i do not get the desired output.
i a pass url parameter (message) to the script.
if i pass a numeric value (1) , the script accepts it as '01' and vice versa.
the same with 0 and '00'
here is the script:
<?php
$theMessage = $_REQUEST['message'];
echo "theMessage : '" . $theMessage . "'\n";
if ($theMessage == "01")
{
echo "message : '01'";}else if ($theMessage == "00") {
echo "message : '00'";}else if (is_numeric($theMessage)) {
echo "Numeric Input : " . $theMessage;}else {
echo "Invalid Input";} ?> i presume that i am not interpreting the data types it should be interpreted. can anyone please help -- Arno Coetzee Flash Media Group Developer Mobile : 27 82 693 6180 Office : 27 12 430 7597