PHP Bulk Delete prompt unexpected ' foreach ' (T_foreach)

Source: Internet
Author: User
Tags parse error

  
   

the error message is: PHP Parse error:syntax error, unexpected ' foreach ' (T_foreach) in I:\php-moive\search_delall.php on line 7
Baidu " unexpected ' (T_foreach)" Almost can't find the relevant answer.

Reply content:


  
   

the error message is: PHP Parse error:syntax error, unexpected ' foreach ' (T_foreach) in I:\php-moive\search_delall.php on line 7
Baidu " unexpected ' (T_foreach)" Almost can't find the relevant answer.

if(is_array($id) && !empty($id)){   <--  这个大括号打成全角了

unexpected xxxUsually the 前面 error content has grammatical errors.

The brackets you use in Chinese

if(is_array($id) && !empty($id)){

The syntax should be correct, the parentheses are wrong. And the $id is an array of words, stitching strings, directly delete from the mysearch where Id in string. There is no need to traverse the execution of multiple SQL statements.


  
   
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.