Is there any builtin function for PHP that will take a boolean value and return its integer equivalent? 0 for FALSE, 1 for TRUE?
Of course you can easily create a function to do so, I'm just asking if there is a builtin function inside of PHP. I already tried intval() and casting it to (int) but they didnt work, they return 0 in both cases of TRUE and FALSE.
Edit : the problem was that it wasnt really a boolean, it was a string "false", "true", php didnt detect the jquery post that it passed a boolean. problem solved, thanks !
解决方案
Normally, simply $myInt = (int)$myBoolean should work, can you show us your code otherwise ?