Ask simple code questions. The following code output results are confusing: $ value = & quot; 100 & quot; bool (true) $ value = true: $ value = & quot; 100 & quot; // define character variables for simple code questions.
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?