Re: Why is the $todaydatestring data type displayed as Boolean?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux