Last active
August 27, 2017 14:50
-
-
Save javedbaloch4/fc06f6a7c1cb0f8ab2290cd69dd6e17d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Casting bools to string | |
*/ | |
$t = true; | |
$f = false; | |
// By default false returns nothing we need to type cast it to int to how 0 | |
$f = (int) $f; | |
// True as string gives | |
$true_string = (string) $t; | |
// False as string gives nothing | |
$false_string = (string) $f; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment