Today, a student asked me a question: why can I run the output index array key without quotation marks? What is the difference between adding and adding quotation marks? Let's look at an example? Php $ url $ _ SERVER [REQUEST_URI]; echo1 ----. $ url.br; $ urlparse_url ($ url); echo2 ----. $ url [path]. br; echo3 --
Today, a student asked me a question: why can I run the output index array key without quotation marks? What is the difference between adding and adding quotation marks? Let's look at an example? Php $ url = $ _ SERVER ['request _ URI ']; echo 1 ----. $ url.br/; $ url = parse_url ($ url); echo 2 ----. $ url [path]. br/; echo 3 --
Today, a student asked me a question: why can I run the output index array without quotation marks? What is the difference between adding and adding quotation marks?
Let's take an example.
"; $ Url = parse_url ($ url); echo" 2 ---- ". $ url [path]."
"; Echo" 3 ---- ". $ url [" path "]."
";
Their output results are as follows: 2 and 3 can both output the same value, but for 2, if there is no configuration-related information in the php. ini configuration file, there will be warning information and no configuration will be available.
Related configuration file: error_reporting = ~ E_NOTICE and output without quotation marks will affect performance! We recommend that you use quotation marks ..