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?