Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick type checking in php, outputs to browser console in admin ajax
// 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