Skip to content

Instantly share code, notes, and snippets.

@jessehub
Created January 29, 2013 19:11
Show Gist options
  • Save jessehub/4666760 to your computer and use it in GitHub Desktop.
Save jessehub/4666760 to your computer and use it in GitHub Desktop.
<?php
function whatis($variable) {
if (gettype($variable) != 'object') {
if (gettype($variable) == 'array') {
foreach ($variable as $k => $v) {
$str .= "['$k']=>'$v' ,";
}
return 'Array ['.$str.']';
}
return gettype($variable);
}
return get_class($variable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment