Dragosvr92 Posted January 7, 2011 Share Posted January 7, 2011 Hello I Have a few problems understanding what to do with this Arrays So if i have a string that echo's : Array ( [TEST1] => Tested 1 [TEST2] => Tested 2 [TEST3] => Tested 3 ) How may i echo the middle line from the array ?? Quote Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/ Share on other sites More sharing options...
Zurev Posted January 7, 2011 Share Posted January 7, 2011 Do you mean echo TEST2's value, or always echo the middle value (if one exists)? If your array is $array, then... echo $array["TEST2"]; Will work just fine, however if it's the middle value, it turns into something a bit more complex I believe. Quote Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/#findComment-1156285 Share on other sites More sharing options...
Dragosvr92 Posted January 7, 2011 Author Share Posted January 7, 2011 yes i meant the " TEST2 " but said middle as it was in the middle Quote Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/#findComment-1156288 Share on other sites More sharing options...
Maq Posted January 7, 2011 Share Posted January 7, 2011 yes i meant the " TEST2 " but said middle as it was in the middle Has your question been answered? Quote Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/#findComment-1156289 Share on other sites More sharing options...
Dragosvr92 Posted January 7, 2011 Author Share Posted January 7, 2011 yes i meant the " TEST2 " but said middle as it was in the middle Has your question been answered? I Just tested it and i got it ! echo "<pre>",print_r($rows),"</pre>"; echo $rows["2"]; Quote Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/#findComment-1156329 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.