[PHP] Manipulating variables

2011-02-23 Thread Ron Piggott
Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web app quiz and I need to test the users

Re: [PHP] Manipulating variables

2011-02-23 Thread Joshua Kehn
I must be missing something, why do you need to use variable variables when checking user answers? The logic should be something like: $answer_key = array('question1' = 'answer', 'question2' = 'answer', ); foreach($answer_key as $q = $a) { check_answer($_POST[$q], $a); } Regards,

Re: [PHP] Manipulating variables

2011-02-23 Thread Robert Cummings
On 11-02-23 11:48 PM, Ron Piggott wrote: Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web

Re: [PHP] Manipulating variables

2011-02-23 Thread Jim Lucas
On 2/23/2011 8:48 PM, Ron Piggott wrote: Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web