syntax - php {$var} meaning -


hello,

what meaning of {$var} in php?

example:

$query = "update table set field = '{$var}'"; 

thx.

{$var} "shields" variable name surrounding characters. example:

$root = "stick"; echo "{$root}y"; # adjectify! 

will output "sticky", where:

$root = "stick"; echo "$rooty"; # adjectify! no, kidding. 

will output nothing @ all, since variable $rooty doesn't exist.

it allows use expressions more variable names, array indexing or property access.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -