帮我解释运行原理和$diqusql.="'{$i}'"的含意
$diqusql="diyu IN(";
foreach($diqu as $i){
$diqusql.="'{$i}',";
}
$diqusql=rtrim($diqusql, ",").")"
foreach是遍历数组的语句,标准用法是:foreach(数据类型 标识符 in 表达式)
e.g:
$person = array( "name1" => "peter", "name2" => "lisi");foreach ($person as $person_value) { echo "姓名:" . $person_value; echo "<br>";}
foreach是遍历数组的语句,标准用法是:foreach(数据类型 标识符 in 表达式)
e.g:
$person = array(
"name1" => "peter",
"name2" => "lisi"
);
foreach ($person as $person_value) {
echo "姓名:" . $person_value;
echo "<br>";
}