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. Quote Link to comment 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>"; } ?> Quote Link to comment Share on other sites More sharing options...
malikah Posted November 17, 2007 Author Share Posted November 17, 2007 Thank you Quote Link to comment 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.