Asheeown Posted February 3, 2007 Share Posted February 3, 2007 I have a variable, say: $Name[1] Is their a way php knows that the sub array is 1? What I mean is getting the number from the sub array and putting it into a different variable? Link to comment https://forums.phpfreaks.com/topic/36955-sub-array-number/ Share on other sites More sharing options...
KrisNz Posted February 3, 2007 Share Posted February 3, 2007 Sounds like you're referring to the array's key. $a = array(); $a['array_key_name'] = 'array_key_value'; $b = key($a); // echo $b; // echos array_key_name You should read this http://au2.php.net/key and this http://au2.php.net/manual/en/function.array-keys.php ..and probably this too http://au2.php.net/foreach Link to comment https://forums.phpfreaks.com/topic/36955-sub-array-number/#findComment-176354 Share on other sites More sharing options...
Asheeown Posted February 3, 2007 Author Share Posted February 3, 2007 Just what i was looking for thanks Link to comment https://forums.phpfreaks.com/topic/36955-sub-array-number/#findComment-176359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.