PHP: custom function for print_r