is this possible the below code
when i run the above script it says $abc doesnt exist ...PHP Code:<?
$abc="somepage.php";
include('$abc');
?>
iam makin such a include coz the value of $abc keeps on changing
is this possible the below code
when i run the above script it says $abc doesnt exist ...PHP Code:<?
$abc="somepage.php";
include('$abc');
?>
iam makin such a include coz the value of $abc keeps on changing
glad to resolve problems in c++ n php
Well, if you place a variable directly in a string, the text itself is part of the string and not the value of the variable. If you want to put a variable in a string you can do it via many methods such as using the {} things around the variable inside the string, or like so:
But for the sake for simplicity, in the code you posted, you can remove the quotes around $abc.PHP Code:$string = "text" . $variable . "more text";
You need to use double quotes (i.e. ") instead of single quotes in your include(), or remove the quotes altogether. Single quotes parse literally (i.e. variables return as their name, not their value), while no quotes and double quotes parse variables as their value.
So, change your include() to one of the following:PHP Code:include("$abc");
include($abc);
thnks guys u made my work a hell lot easier
coz i was not able to include i had to use a long 12 line function to do it
glad to resolve problems in c++ n php