note 80000 added to function.include
| From: | rumkinatyandexdotru at osu1 dot php dot net | Date: | Sun, 23 Dec 2007 14:08:56 +0000 |
| Subject: | note 80000 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133900@lists.php.net to get a copy of this message | ||
Hi i've got such problem:
<?php
function my_include($file_path){
//...
include($file_path);
//...
}
?>
but when file from $file_path included my variables became undefined. But they exist in $GLOBALS.
Such way i couldn't get my variable to one script to another without using global keyword in
included script.
That's an example:
file a.php:
<?php
$a = 1;
my_include("./b.php");
?>
file b.php:
<?php
$b = $a + 1; //Notice Undefined variable: a
//...
?>
What I've got to do?
----
Server IP: 195.54.192.44
Probable Submitter: 91.122.100.249
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/80000
Del: integrated -- https://master.php.net/note/delete/80000/integrated
Del: useless -- https://master.php.net/note/delete/80000/useless
Del: bad code -- https://master.php.net/note/delete/80000/bad+code
Del: spam -- https://master.php.net/note/delete/80000/spam
Del: non-english -- https://master.php.net/note/delete/80000/non-english
Del: in docs -- https://master.php.net/note/delete/80000/in+docs
Del: other reasons-- https://master.php.net/note/delete/80000
Reject -- https://master.php.net/note/reject/80000
Search -- https://master.php.net/manage/user-notes.php