Help me explain the operating principle and the meaning of $diqusql.="'{$i}'"
$diqusql="diyu IN(";
foreach($diqu as $ i){
$diqusql.="'{$i}',";
$diqusql=rtrim($diqusql, ",")." )"
foreach is a statement that traverses an array. The standard usage is: foreach (data type identifier in expression)
e.g:
$person = array( "name1" => "peter", "name2" => "lisi");foreach ($person as $ person_value) { echo "Name:" . $person_value; echo "<br>";}
foreach is a statement that traverses an array. The standard usage is: foreach (data type identifier in expression)
e.g:
$person = array(
"name1" => "peter",
"name2" => "lisi"
);
foreach ($person as $ person_value) {
echo "Name:" . $person_value;
echo "<br>";
}