I tried to do somthing like that:
$cat1 = array('hello', 'everyone');
$cat = array('bye', 'everyone');
for($index = 0; $index < 2; $index++) {
echo $cat$index[1];
}
It doesn’t work of course.
What do I need to change here?
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 should use nested arrays, but this can be done.
Reference: http://php.net/language.variables.variable
This would be much better though: