background preloader

PHP

Facebook Twitter

PHP Manual. Static Keyword. Use Of Complex (Curly Bracket) Syntax. PHP Tutorials Examples phPro - Tutorials Articles Examples Development. Variable variables. Sometimes it is convenient to be able to have variable variable names.

Variable variables

That is, a variable name which can be set and used dynamically. A normal variable is set with a statement such as: A variable variable takes the value of a variable and treats that as the name of a variable. In the above example, hello, can be used as the name of a variable by using two dollar signs. i.e. Use of Complex (Curly Bracket) Syntax. Ken in Melbourne Australia (ken@mira.net) wrote: : If I use the curly bracket syntax (referred to as the : complex syntax) within a string, how do I get to call a : function within it?

Use of Complex (Curly Bracket) Syntax

: The php manual says that the first (or previous) : character for the curly bracket has to be a dollar sign '$'. also says "you can include any value that is in the namespace" That doesn't sound to me like you can call a function, since the function is not a value (instead it creates a new value and returns it, and the result is not in any name space since it is not in a variable.)