For example:
$fruits = array(
1 => 'apples',
2 => 'lemons',
3 => 'bananas'
);
Is there a function to output lemons, without using $fruits[2]?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use next(), current(), prev(), end() set of functions. You could use a foreach on the array. You could use the list($var,$var1,$var2…) = $arr construct. Be more specific as to what you’re trying to do.
EDIT: