Created
July 13, 2012 20:00
-
-
Save jameshibbard/3107044 to your computer and use it in GitHub Desktop.
Inspect an object in PHP
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
<?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