Hello ,
How can I access an array which is in one php file say file1.php in another php file say file2.php.
Thanks in advance
Include file1.php in file2.php
laserlight;10888231 wrote:Include file1.php in file2.php
I get an error message
Notice: Undefined variable: var1 ..........
I used var1 in file1.php and included it in file2.php
Try this:
<?php // file1.php $var1 = 'hello'; ?>
<?php // file2.php include 'file1.php'; echo $var1; ?>