Anyone know about PHP?
#9

Quote:
Originally Posted by Coltmaster
Посмотреть сообщение
How does it work with single quotations?- Oh it works fine how it is.

So why doesn't it work fine inside the double quotations like it says in my book, is this a change in the new version of PHP?
There is no difference between single and double quotes in php. It's just good practice to use single quotes for arrays/indexes and double qoutes for declarations of strings (although it's more of a personal preference - I use single quotes as much as I can).

For example, it's common to do:
PHP код:
$_GLOBALS['some_index'
and:
PHP код:
$string "This is a string"
EDIT: There isn't a difference in performance either (not in the new PHP versions anyways).
http://nikic.github.io/2012/01/09/Di...ance-Myth.html
Reply


Messages In This Thread
Anyone know about PHP? - by Coltmaster - 07.04.2013, 22:28
Respuesta: Anyone know about PHP? - by OPremium - 07.04.2013, 22:46
Re: Anyone know about PHP? - by Pizzy - 07.04.2013, 22:48
Re: Anyone know about PHP? - by Coltmaster - 07.04.2013, 23:28
Re: Anyone know about PHP? - by Pizzy - 07.04.2013, 23:59
Re: Anyone know about PHP? - by Coltmaster - 08.04.2013, 00:11
Re: Anyone know about PHP? - by spacemud - 08.04.2013, 00:26
Re: Anyone know about PHP? - by Coltmaster - 08.04.2013, 00:41
Re: Anyone know about PHP? - by Sinner - 08.04.2013, 09:44
Re: Anyone know about PHP? - by InfiniTy. - 08.04.2013, 10:34

Forum Jump:


Users browsing this thread: 1 Guest(s)