keithschm Posted October 6, 2006 Share Posted October 6, 2006 I have an array and I am not sure what is in it or how deep it is or what the seperater is. is there any way to just dump an array? if you echo the array it displays ARRAY if I use explode I get nothing as I m not sure what the seperater isThanks Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/ Share on other sites More sharing options...
printf Posted October 6, 2006 Share Posted October 6, 2006 [code]print_r ( $array );orvar_dump ( $array );[/code]me! Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105030 Share on other sites More sharing options...
Daniel0 Posted October 6, 2006 Share Posted October 6, 2006 You can use var_export as well. It will output it as the way you would define it in PHP.That could be useful for editing configuration files consisting of an array. Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105034 Share on other sites More sharing options...
kenrbnsn Posted October 6, 2006 Share Posted October 6, 2006 If you want the output from any of those functions to be readable in the browser window, surround them with [nobbc]<pre></pre>[/nobbc] tags. For example:[code]<?phpecho '<pre>' . print_r($somearray,true) . '</pre>';?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105058 Share on other sites More sharing options...
keithschm Posted October 6, 2006 Author Share Posted October 6, 2006 WOWthank you all so much for your help.now this array seems very comlicated to me as it looks like arrays inside arrays[code]Array( [0] => Array ( [1DA] => 27.84 ) [1] => Array ( [1DP] => 24.23 ) [2] => Array ( [2DA] => 14.33 ) [3] => Array ( [3DS] => 10.60 ) [4] => Array ( [GND] => 6.65 ))[/code]it is the return values for ups quotes. I need to alter it. the text is the shipping type and the numbers is the cost. I need to subtract the value associted with the GND from all the other vales in the arrayI tried "for each" but I am lostany sugestionthanks Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105074 Share on other sites More sharing options...
HuggieBear Posted October 6, 2006 Share Posted October 6, 2006 How are you propogating the array?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105090 Share on other sites More sharing options...
keithschm Posted October 6, 2006 Author Share Posted October 6, 2006 [quote author=HuggieBear link=topic=110697.msg448063#msg448063 date=1160149859]How are you propogating the array?RegardsHuggie[/quote]what do you mean? Quote Link to comment https://forums.phpfreaks.com/topic/23180-how-to-see-what-is-in-an-arrayall-fixed-thanks-all/#findComment-105102 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.