PHP code for matching multiple values in a switchcase code block

Source: Internet
Author: User
Tags case statement switch case
PHP has been thinking about the code that matches multiple values in a code block in the switchcase statement recently, in the switchcase statement of PHP, the code that matches multiple values in a code block does not include the code that we usually use multiple case matches but does not jump out of (break). Is there anything like VB, you can use braces or brackets to separate the matching values with commas (,) or underscores (|). you cannot try it any way. on the internet, someone may say "|" to separate them, the code is then matched by multiple values in the switch case statement of a group of PHP code blocks.

Recently, I have been thinking that the code that matches multiple values in the switch case statement of PHP to a code block does not jump out of the break syntax except for the code that often matches multiple cases, is there any other way to use braces or brackets like VB to separate matching values with commas (,) or underscores (|, on the Internet, there are people who say they can use "|" to separate them, and then they will be reposted by a group of people. this is really a mistake!

?

Switch ($ cps_sign) {case 'iqifa ': case 'chengguo': case 'roiyiqifa': case 'lkt ': case 'fanli': case 'qqfanli ': case 'weiyi': case 'yoyi': $ SQL = "INSERT into sa_cps_list ('u','s _ time', 'CP', 'URL ') VALUES ('{$ uv}', {$ timestamp}, '{$ cps_sign}', '{$ url}') "; echo $ SQL; exit (); mysql_query ($ SQL); break; default: break ;}

?

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.