Skip to content

Instantly share code, notes, and snippets.

@jameshibbard
Created July 13, 2012 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameshibbard/3107044 to your computer and use it in GitHub Desktop.
Save jameshibbard/3107044 to your computer and use it in GitHub Desktop.
Inspect an object in PHP
<?php
// get_term_by returns an object
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$array = get_object_vars($term);
while (list($key, $val) = each($array)) {
echo "$key => $val"."<br />";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment