Stats: 3,186,780 members, 7,930,665 topics. Date: Sunday, 25 August 2024 at 02:45 AM |
Nairaland Forum / Science/Technology / Webmasters / Single Vs Double Quotes In PHP (550 Views)
I Need Olx Or Jiji Classified Clone Script In PHP / Urgent Help To Display Data In Php / 25 Quotes From Blogging Experts At West Africa Bloggers Conference (2) (3) (4)
(1) (Reply)
Single Vs Double Quotes In PHP by maekhel(m): 12:01pm On Jan 06, 2015 |
Today we will be taking a quick look at Single vs Double Quotes In PHP. This is going to be a very brief tutorial. Most people (myself inclusive) misuse this quotes. Now that I understand where and when they are being used, I decided to share it with you guys. The Single Quotes (”) The single quotes will not interpret the value of the variables enclosed in them. The single quotes will output the string as they are without any interpretation. Let demonstrate this with example: When the code snippets above is executed, it will out put: This lesson is from $variable. This is to show that the single quotes will display whatever it contains as it is. The Double Quotes (“”) The Double Quotes unlike the Single Quotes will not only output values but also interpret any variables it contains. Let use the same example from above to demonstrate Double Quotes: When this code is executed, the PHP HyperText Preprocessor will parse the $variable in the double quotes and replace it with the value which that variable holds. So our code will output: This lesson is from Tutorialslodge. So you now know when and where to use each of the quotes. Remember if you want your variables to be interpreted, use Double Quotes, hence use Single Quotes. I hope this tutorial is helpful. Kindly drop your comments, questions, suggestions and views in the box below. source: http://tutorialslodge.com/single-vs-double-quotes-php/ 1 Like |
Re: Single Vs Double Quotes In PHP by emmyvet(m): 2:50pm On Jan 06, 2015 |
maekhel:Ya is helpful thanks |
Re: Single Vs Double Quotes In PHP by maekhel(m): 3:04pm On Jan 06, 2015 |
emmyvet:Glad it was helpful 1 Like |
(1) (Reply)
Webmasters Kindly Review My Blog / Structured Query Language Injection (sqli) Thread / India Well Known Brand XOLO, Has Officially Unveiled Their Latest Device Black X
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10 |