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 ?? 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. 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 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? 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"]; Link to comment https://forums.phpfreaks.com/topic/223692-echo-data-from-array/#findComment-1156329 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.