GD77 Posted August 9, 2012 Share Posted August 9, 2012 Hello: How to get specific value of specific key? $tst=array(0=>array('val1','val2'), 1=>array('val3','val4')); like val4 from key 1 or val 2 from key 0. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/ Share on other sites More sharing options...
MarPlo Posted August 9, 2012 Share Posted August 9, 2012 Hi, I think it is about something like this: $tst = array(0=>array('val1','val2'), 1=>array('val3','val4')); $v1 = $tst[1][1]; $v2 = $tst[0][1]; Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368036 Share on other sites More sharing options...
GD77 Posted August 9, 2012 Author Share Posted August 9, 2012 this is what m trying to achieve: $fetch_T=mysql_fetch_assoc($qry_T); print_r (."$fetch_T['2']['1']."); Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368041 Share on other sites More sharing options...
Barand Posted August 9, 2012 Share Posted August 9, 2012 Start with echo '<pre>' . print_r($fetch_T, true) . '</pre>'; so you can see what the array looks like Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368042 Share on other sites More sharing options...
GD77 Posted August 9, 2012 Author Share Posted August 9, 2012 @Barand: want it to be selective not whole data... you should be able to select what you need... Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368043 Share on other sites More sharing options...
Barand Posted August 9, 2012 Share Posted August 9, 2012 OK, if you don't want help debugging your problem, good luck. Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368044 Share on other sites More sharing options...
GD77 Posted August 9, 2012 Author Share Posted August 9, 2012 ya I saw it was a normal array not associative :/ Quote Link to comment https://forums.phpfreaks.com/topic/266846-array-specfic-value-for-specific-key/#findComment-1368047 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.