<? PHP # boolean data type details: false # ① false itself # ② $ A = 0/* $ A = 0; if ($ A = false) {echo "false! ";}*/# ③ $ A = 0.0/* $ A = 0.0; if ($ A = false) {echo" not true ~ ";} */# ④ $ A =" "(empty string)/* $ A =" "; if ($ A = false) {echo" this is not true! ";} */# ⑤ $ A = NULL/* $ A = NULL; if ($ A = false) {echo" null is false! ";} */# No element in the array is false #7. What is the object that does not contain any member variables?>
<? PHP // floating-point data details // ① the precision of the floating-point data type is 14, and the calculation method starts from the left to the first digit not 0. // ② Case // $ A = 0.123456789012345; // echo '$ A = '. $ A; // The result is: $ A = 0.12345678901234 // If $ A = 0.123456789012346; $ A = 0.123456789012346; $ B = 0.000006789012345; // The result is: $ B = 6.789012345e-6 echo '$ B = '. $ B;?>
<? PHP // string note details // one character E. g A occupies one byte // ① difference between single quotation marks and double quotation marks // Example 1: Echo ① difference between single quotation marks and double quotation marks 1 double quotation marks parse variables <br/> '; $ I = 90; $ user1 = "Hello $ I"; $ user2 = 'Hello $ I '; echo' $ user1 = '. $ user1; echo '<br/> $ user2 = '. $ user2; // The result is: $ user1 = hello90 // $ user2 = Hello $ iecho '<HR/> '; // use double quotation marks to parse special characters. // For example, Echo '② difference between single quotation marks and double quotation marks. 2 double quotation marks will parse special characters. <br/> '; $ V1 = "ABCD \" "; $ v2 = 'abcd \" '; echo 'v1 = '. $ V1; echo '<br/> v2 = '. $ V2; echo '<HR/>'; // double quotation marks are used to parse double quotation marks, and single quotation marks are used to parse single quotation marks echo '③ single quotation marks and double quotation marks Double quotation marks are enclosed in double quotation marks. single quotation marks are enclosed in single quotation marks. <br/> '; $ V1 = 'abcd \ ''; $ v2 =" ABCD \'"; echo 'v1 = '. $ V1; echo '<br/> v2 = '. $ V2;?>
Expression: A value is an expression. Example: $ A = 90;
<? PHP // PHP Arithmetic Operator // determines whether two numbers can be divisible by $ A = 5; $ B = 1; if ($ A % $ B = 0) {echo 'a can divide B, and the result is :'. ($ A % $ B);} else {echo 'a cannot divide B, and the result is :'. ($ A % $ B) ;}?>