usually there is no need to do so

!empty($val) as well as if($val) works on both types the same way

you could easily cast to bool, though:
$x = (bool)$val;

1 => true
0 => false


On 9 Okt., 01:36, Xhaphir <hel...@coffeecoder.de> wrote:
> Hi,
>
> i have a small problem in cakePHP. I saved a lot of booleans and
> integers in a mySQL Database and
> cakePHP is converting my boolean values nicely to a tinyint. But not
> back.
>
> In most cases this is not a problem but I would like to iterate over
> all values and convert all booleans to "yes"/"no".
> In this case I am unable to determine if a value is a boolean or an
> integer.
>
> Maybe I'm just don't see the solution..
>
> Thanks for your help,
> Helmut
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to