Hi
Can I do this:
$file="articledetails.php";
include('$file');
I really need it or something similar to make my pages more dynamic
include('$file');
Moderator: General Moderators
or even better: no quotes at all.
"$var" is a wide-spread nonsense.
Code: Select all
$file="articledetails.php";
include $file;- mabufo
- Forum Commoner
- Posts: 81
- Joined: Thu Jul 10, 2003 11:11 pm
- Location: Orland Park, IL
- Contact:
Code: Select all
include("nameoffile.php");- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
include is not a function, it is a language construct. As such, it doesn't require parentheses.
You never have to wrap a variable in quotes unless you are including plain, outputable text with it, and even then you can concatenate instead of parsing.
Try something before you ask if it can be done (really, in this case, how hard would that have been?).
You never have to wrap a variable in quotes unless you are including plain, outputable text with it, and even then you can concatenate instead of parsing.
Try something before you ask if it can be done (really, in this case, how hard would that have been?).