我正在try 更新我们用来连接到数据库的类,有大量对$res->fetchInto($_row);
的调用,我不想把所有的调用都替换为$_row = $res->fetchInto();
.有没有办法调用一个函数并让它将结果返回给传递给该函数的变量名?
示例:
$_row = array();
$res->fetchInto($_row);
echo "Lets print out the array<br>";
echo "<pre>";
print_r($_row);
echo "</pre>";
echo "Lets loop through all outputted rows
while ($res->fetchInto($_row)) {
echo "<pre>";
print_r($_row);
echo "</pre>";
echo "<hr>";
}
function fetchInto($arrName) {
// PROCESSING HERE
return $arrName;
}