another Array question

From: Date: Tue, 11 Sep 2012 04:41:05 +0000
Subject: another Array question
Groups: php.general 
Request: Send a blank email to php-general+get-319031@lists.php.net to get a copy of this message
Hello everyone, I have a very long array. I want to pull all the data from the array from a certain position to a certain position. $myarray = array('0'=>'me', '1'=>'you','2'=>'her','3'=>'him','4'=>'them', '5'=>'us'); Yes I know the array above it small it's an example, mine has over 150 positions. $foundyou = array_search('you', $myarray); $foundthem = array_search('them', $myarray); Now I want to take all the array positions from $foundyou to $foundthem and put their values into a variable; For the life of me I can't remember how I did it. I DO NOT want to foreach over the array positions that would be counterproductive.

« previous php.general (#319031) next »