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 in:
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.