I have this error when I try to execute my php code:
Parse error: syntax error, unexpected '&' in /opt/lampp/htdocs//app/engine.class.php on line 34
private function setMatches($doc)
{
$strMatches = array();
$positions = $this->getPositions($doc);
foreach ($positions as $v)
{
$start = $v;
$end = 1;
$v++;
while ($end !== 0)
{
if (preg_match("/^<div/", &$doc[$v]))
$end++;
else if (preg_match("/^<\/div/", &$doc[$v]))
$end--;
$v++;
}
$end = $v - 1;
$strMatches[] = substr($doc, $start, $end - $start);
}
print_r($strMatches);
}
So, here I try to get the address of the character, to pass it in the preg match function as a string. i dont get it, any idea?