Problem in Accessing Variable value across php files
Posted: Sun Nov 08, 2009 5:15 am
Hi,
As the title says it all.
Problem in Accessing Variable value across php files.
I have two .php files.
I have simplied the code to give as an example.
here is the code of both php
functions.php
index.php
Now, when i execute, 10 shuld be printed?
if not then how to do it.
because i have 4 variables in functions.php
As the title says it all.
Problem in Accessing Variable value across php files.
I have two .php files.
I have simplied the code to give as an example.
here is the code of both php
functions.php
Code: Select all
<?php
function getValue()
{
$a=10;
}
?>Code: Select all
<?php
require_once('functions.php')
getValue();
echo $a;
?>if not then how to do it.
because i have 4 variables in functions.php