Vars with curly brakets don't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Vars with curly brakets don't work

Post by amir »

I've just installed a program on my server that is using variables with curly brakets, here is some code from it:

Code: Select all

require_once( "inc/header.inc.php" );
require_once( "{$dir['inc']}design.inc.php" );

include( "{$dir['root']}templates/tmpl_{$tmpl}/scripts/index.php" );
the $dir is defined in header.inc.php, if I just echo right under the first line I get the value of the variable, however anything below {} does not work. Is it something in php.ini that needs to be changed?

Thanks,
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

No, there's no config parameter that allows or disallows "..{$var}.."
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: Vars with curly brakets don't work

Post by jmut »

amir wrote:I've just installed a program on my server that is using variables with curly brakets, here is some code from it:

Code: Select all

require_once( "inc/header.inc.php" );
require_once( "{$dir['inc']}design.inc.php" );

include( "{$dir['root']}templates/tmpl_{$tmpl}/scripts/index.php" );
the $dir is defined in header.inc.php, if I just echo right under the first line I get the value of the variable, however anything below {} does not work. Is it something in php.ini that needs to be changed?

Thanks,
and what is the problem.......if display_errors = on and error_reporting(E_ALL) says nothing...and your files are still not included...then..yes you can say curly braces doesn't work
Post Reply