Re: Why is the $todaydatestring data type displayed as Boolean?
| From: | James Crow | Date: | Thu, 11 Sep 2008 14:38:54 +0000 |
| Subject: | Re: Why is the $todaydatestring data type displayed as Boolean? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-29028@lists.php.net to get a copy of this message | ||
On Thu, 2008-09-11 at 18:53 +0530, Varuna Seneviratna wrote:
> Why is the $todaydatestring data type displayed as Boolean?
>
> <?php
> $todaydate=11092008;
> echo "The data type of todaydate is
> ".gettype($todaydate)."</br>";
> $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