Created
January 6, 2017 07:47
-
-
Save n8finch/fd6084b80267692c4899fe4f5024980d to your computer and use it in GitHub Desktop.
Quick type checking in php, outputs to browser console in admin ajax
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
// Quick type checking in php, outputs to browser console in admin ajax | |
echo 'Type: '. gettype($bc_exists) . "\n"; | |
echo 'Null: '. is_null($bc_exists) . "\n"; | |
echo 'Array: '. is_array($bc_exists). "\n"; | |
echo 'isset: '. is_array($bc_exists). "\n"; | |
echo 'Empty: '. empty($bc_exists). "\n"; | |
echo 'Boolean: '. is_bool($bc_exists). "\n"; | |
echo 'String: '. is_string($bc_exists). "\n"; | |
echo 'Object: '. is_object($bc_exists). "\n"; | |
echo 'Value Array: '. print_r($bc_exists) . "\n"; | |
echo 'Value String: '. $bc_exists . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment