You are here: Re: [PHP] Newbie question: qutoes? « PHP « IT news, forums, messages
Re: [PHP] Newbie question: qutoes?

Posted by Richard Lynch on 03/08/05 20:06

James Williams wrote:
> rory walsh wrote:
>> Can anyone tell me if there is a difference between double quotes and
>> single quotes? Cheers,
>> Rory.
>
> What's up Rory... actually there *is* a difference. Double quotes are
> parsed by the php engine, meaning it goes through and finds variables
> and stuff which it can parse, ex. print("Here is a variable:
> $variable!"); will print "Here is a variable: The value of the variable!"
>
> Single quotes are not parsed by the php engine, so the same code with
> single quotes (print('Here is a variable: $variable!'); will return
> "Here is a variable: $variable!" I hope that answeres your question

This is not quite 100% correct.

PHP still parses single quotes, but only replaces two (2) special
character combinations:

\' turns into '
\\ turns into \

The point is that you still might want to embed an apostrophe in single
quotes, and so you use \ for that, and you might want to embed \ so you
use \ for that as well.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация