PHP entry variable string, PHP entry variable _php tutorial

Source: Internet
Author: User

PHP entry variable string, PHP entry variable


A string is just a piece of characters enclosed in quotation marks: letters, numbers, spaces, punctuation, and so on.

All of the following are strings:

?
1234 'Huige'"In watermelon sugar" '100' 'August 2, 2011'

FAQ:

"1" When creating a string, you can enclose the character in single or double quotation marks, and you must use the same type of quotation marks at the beginning and end of the character.

"2" If the same quotation marks appear in the middle of the string, it can be escaped by placing a backslash before the problematic character (the character in question is a double quotation mark, and you will later learn about the other problematic character):

?
123 $var = "Define \"platitude\", please.";?>

Another way is to use single quotation marks (this way is to use single quotes when printing double quotes, and vice versa):

?
123 $var = 'Define "platitude", please.'; ?>

"3" If the same variable is assigned a value of 2 times (for example: $book), the new value overrides the old value.

?
1234 $book = 'High Fidelity'; $book = 'The Corrections'; ?>

The results are printed on their own, so that you can verify that the old values are not rewritten under the new values.

http://www.bkjia.com/PHPjc/1095122.html www.bkjia.com true http://www.bkjia.com/PHPjc/1095122.html techarticle a string of PHP entry variables, the PHP entry variable string is just a block of characters enclosed in quotation marks: letters, numbers, spaces, punctuation, and so on. All listed below are strings ...

  • Related Article

    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.