malikah Posted November 17, 2007 Share Posted November 17, 2007 Hi, is there an alternative to the print_r command - I would like to see my array without all the extra stuff - just want to see my array, pure and simple. The same way actionscript would display it. Cheers. Link to comment https://forums.phpfreaks.com/topic/77727-solved-print_r-alternative/ Share on other sites More sharing options...
rarebit Posted November 17, 2007 Share Posted November 17, 2007 You could make your own function out of something like this: <?php $a = array(); $a['one'] = 1; $a['two'] = 2; $a['three'] = 3; foreach ($a as $k => $v) { print "".$k.": ".$v."<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/77727-solved-print_r-alternative/#findComment-393430 Share on other sites More sharing options...
malikah Posted November 17, 2007 Author Share Posted November 17, 2007 Thank you Link to comment https://forums.phpfreaks.com/topic/77727-solved-print_r-alternative/#findComment-393432 Share on other sites More sharing options...
rarebit Posted November 17, 2007 Share Posted November 17, 2007 Here's the annoying version... function print_a($a) { print "Array( "; foreach ($a as $k => $v) { print "[".$k."] => ".$v." "; } print ")"; } print_a($a); Link to comment https://forums.phpfreaks.com/topic/77727-solved-print_r-alternative/#findComment-393434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.