Why is the $todaydatestring data type displayed as Boolean?

Why is the $todaydatestring data type displayed as Boolean?

am 11.09.2008 15:23:50 von Varuna Seneviratna

------=_Part_103262_6822928.1221139430724
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Why is the $todaydatestring data type displayed as Boolean?

$todaydate=11092008;
echo "The data type of todaydate is
".gettype($todaydate)."
";
$mydatestring=settype($todaydate,"String");
echo "The data type of mydatestring is ".gettype($mydatestring);




?>

Varuna

--
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620
Mobile:0715617141

------=_Part_103262_6822928.1221139430724--

Re: Why is the $todaydatestring data type displayed as

am 11.09.2008 16:38:54 von James Crow

On Thu, 2008-09-11 at 18:53 +0530, Varuna Seneviratna wrote:
> Why is the $todaydatestring data type displayed as Boolean?
>
> > $todaydate=11092008;
> echo "The data type of todaydate is
> ".gettype($todaydate)."
";
> $mydatestring=settype($todaydate,"String");
> echo "The data type of mydatestring is ".gettype($mydatestring);
>
>
>
>
> ?>
>
> Varuna

Varuna,

The settype() function returns a boolean response for success/failure.
The variable $mydatestring is the response from setype() and not the
type of the function. If you add this:

echo "The data type of todaydate is ".gettype($todaydate);

It will respond as you expect.

Thanks,
James



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