foreach usage
三 剑
三 剑 2019-01-02 14:56:30
0
2
981

Help me explain the operating principle and the meaning of $diqusql.="'{$i}'"

$diqusql="diyu IN(";

foreach($diqu as $ i){

            $diqusql.="'{$i}',";

                                    $diqusql=rtrim($diqusql, ",")." )"

三 剑
三 剑

reply all(1)
保哥后院

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>";
}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!