Page 1 of 1

i have a question about code

Posted: Mon Jan 07, 2008 4:10 pm
by goldenfaith
like this, why need "{ }" around var: $phpbb_root_path and $user->data['user_id']
thank you!
code1

Code: Select all

die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
code2

Code: Select all

WHERE user_id = {$user->data['user_id']}

Re: i have a question about code

Posted: Mon Jan 07, 2008 4:20 pm
by zeroK
http://www.php.net/manual/en/language.types.string.php :-)

The curly braces around the variable first of all allow you to put more than just normal variables inline into a string (for instance object variables) but they also make the code more readable :-)

Re: i have a question about code

Posted: Mon Jan 07, 2008 5:34 pm
by goldenfaith
i see. :)
thank you very much.