code:
public function isQuestion($query){
$questions = $this->getAllQuestions();
if (count($questions)){
foreach ($questions as $q){
if ($this->isQuestion$q($query)){
return $this->isQuestion$q($query);
}
}
}
return false;
}
error:
Parse error: syntax error, unexpected T_VARIABLE in /Applications/XAMPP/xamppfiles/htdocs/ai/application/models/question_model.php on line 7
the problem occurs on
if ($this->isQuestion$q($query)){
return $this->isQuestion$q($query);
i have some functions like isQuestion1, isQuestion2, isQuestion3 etc... and i call another function *getAllQuestions* that will return me all the numbers of the questions in an array like 1,2,3,4,5... then i use the above code to check if each function is a question based on a query
$this->isQuestion{$q}($query)
– Lawrence Cherone Aug 30 '12 at 9:51