Thank you curly brackets!
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Thank you curly brackets!
The braces aren't actually needed Tongue

PHP Code:
foreach($vars as $key => &$val) $$key =& $val;

Or you could do:

PHP Code:
extract($vars);


If it's for some templating system, you could just directly reference the array.  If a full templating system, I'd probably pre-parse it into .php files and reference the array that way.


My Blog
(This post was last modified: 07-14-2010 08:11 AM by ZiNgA BuRgA.)
07-14-2010 07:58 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Thank you curly brackets! - Pirata Nervo - 07-14-2010, 04:00 AM
RE: Thank you curly brackets! - ZiNgA BuRgA - 07-14-2010 07:58 AM

 Standard Tools
Forum Jump: