I wrote a code like this in a function:
preg_match_all('/{ali\s+([^}\s]+)\s*}/', $row->text, $matches, PREG_SET_ORDER);
$m=$matches[0][1];
When I write this:
$row->text=$m;
It returns the value (for example "name" in "{ali name}" and "id" in "{ali id}"),but when I write this:
$a->name='hasan';
$a->id='14';
$row->text=$a->$m;
It says:
Notice: Undefined offset: 0 in ... on line 2
What's the problem?! I tested existance of spaces,tabs,etc in the string but there was not any of them!