I've been trying to create a function in which it will return two values.
One via the regular route of:
return $x;
and the other via a reference in a manner similar to $matches[] in (eg. preg_match)
right now I have something like:
function foo($query, &$matches)
{
$result = $this->db->query($query);
if ($result !== false)
{
$matches = &$this->db->getRows();
return count($matches);
}
return 0;
}
Even if count($rows) is greater than zero though, $matches never contains anything. I'm obviously missing something from the References Explained.
Also, is it not possible to do this:
function foo($query, &$matches = null)
Can anyone help?