Skip to content

Instantly share code, notes, and snippets.

@owaincuvelier
Created May 28, 2012 09:18
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 owaincuvelier/2818101 to your computer and use it in GitHub Desktop.
Save owaincuvelier/2818101 to your computer and use it in GitHub Desktop.
A piece of code which simply helped me to display two sets of information side by side.
<?php
/**
* Prints json decoded version of XML Object or a SimpleXML Object.
*
* @param $jsondecode If is left will print json_decoded version
* @author Owain Cuvelier owain@humanmade.co.uk
*/
function ohm_handle_lastfm_data( $jsondecode = false ) {
if ( $jsondecode )
print_r( ohm_get_lastfm_data() );
else
print_r( json_decode( json_encode( ohm_get_lastfm_data() ), true ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment