Simple code problems

Source: Internet
Author: User
Ask simple code questions. The following code output is confusing. the code result is $ value & quot; 100 & quot; bool (true) $ valuetrue. the code is as follows: $ value & quot; 100 & quot; define the character variable as 100 echo & quot; $ value & quot; ask a simple code question when outputting data.
The following code output results are confusing: $ value = "100" bool (true) $ value = true




The code is as follows:
$ Value = "100"; // defines the character variable as 100
Echo "\ $ value = \" $ value \ ""; why is the bool type output ??

Var_dump ($ value = 100); how is this true ???
Echo"

\ $ Value = true ";

------ Solution --------------------
Var_dump ($ value = 100)
Try this.
------ Solution --------------------
No output problems

First: echo "\ $ value = \" $ value \ ""; output $ value = "100"
Second: var_dump ($ value = 100); is a judgment, equivalent to $ value = 100? True: false, output bool (true)
Third: echo"

\ $ Value = true "; of course, $ value = true is directly output.

The result is correct. what kind of output result do you want?

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.