📜  在 while 循环(范围)之外使用变量 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:36.057000             🧑  作者: Mango

代码示例1
#How to use a variable outside of the while loop (scope)

#You could try to define the variable before the loop, e.g.

$report = "";
while ($row = mysql_fetch_array($result)) {
    $report .= $row["prevDOCid"];
}
echo $report;