Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,184 members, 7,953,654 topics. Date: Thursday, 19 September 2024 at 09:56 PM |
Nairaland Forum / Science/Technology / Webmasters / Single Vs Double Quotes In PHP (554 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)
Girls Only!!! / Help On Free Bulk Sms Ebook / How To Promote Your Blog
(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. 12 |