How to write the actual code of the PHP string connection _php Tutorial

Source: Internet
Author: User
To allow multiple strings to be bridged, use one (.) " Point "number, for example:

 
  
  
  1. Php
  2. $ name "W3pop";
  3. echo $name. " COM ";
  4. ?>

The above output is w3pop.com

There is a case where a PHP string is connected, and when Echo uses the (") double quotation mark, you can achieve the same effect as the following:

 
  
  
  1. Php
  2. $ name "W3pop";//The same sentence
  3. echo "$name. com";//the variable in double quotes can be displayed normally,
    and is automatically separated from the normal string.
  4. ?>

However, if it is a single quote, the contents of the content will be fully exported to the browser in string form:

 
  
  
  1. Php
  2. $ name "w3pop.com";
  3. echo ' $name. com ';
  4. ?>

will display $name.com

PHP string Connection Sample code:

 
 
  1. Php
  2. $ name = "W3pop" ;
  3. echo $name. " COM ";
  4. ?>
  5. < BR />
  6. Php
  7. $ name = "W3pop" ;
  8. echo "$name. com";
  9. ?>
  10. < BR />
  11. Php
  12. $ name = "W3pop.com" ;
  13. echo '. com ';
  14. ?>

Output results

W3pop.com

W3pop.com.com

$name. com

How about, everyone through the above three pieces of code to demonstrate, have you mastered the method of PHP string connection?


http://www.bkjia.com/PHPjc/446324.html www.bkjia.com true http://www.bkjia.com/PHPjc/446324.html techarticle To allow multiple strings to be bridged, use one (.) " Point "number, for example:? PHP $ name = "W3pop"; Echo$name. ". Com ";? The above output is that w3pop.com has a PHP string connection ...

  • 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.