Re: Export local variable to global variable scope?
- From: howa <howachen@xxxxxxxxx>
- Date: Sat, 29 Sep 2007 17:27:28 -0000
Assume that I know nothing about the stuffs inside bar.php...is it
possible?
On 9 29 , 9 49 , Bruno Barros <rage...@xxxxxxxxx> wrote:
On 29 Sep, 13:23, howa <howac...@xxxxxxxxx> wrote:
Hello,
I have a function, e.g.
function foo() {
include("bar.php");
}
and the bar.php contain contents e.g.
$global_v1 = "abc";
$global_v2 = "def";
I want to execute function foo(), but at the same time, let the
variables declared in bar.php to have global scopem is it possible?
Thanks.
function foo() {
global $global_v1;
global $global_v2;
include "bar.php";
}
Good enough?
---
Bruno Rafael Moreira de Barros
Adobe Photoshop CS2 and CS3
-
XML / XSLT
-
MySQL / SQLite / TerraDB
-
PHP 3, 4, 5 and 6
:: Looking For A Permanent Job ::
---
.
- Follow-Ups:
- Re: Export local variable to global variable scope?
- From: Rik Wasmus
- Re: Export local variable to global variable scope?
- References:
- Export local variable to global variable scope?
- From: howa
- Re: Export local variable to global variable scope?
- From: Bruno Barros
- Export local variable to global variable scope?
- Prev by Date: Can this be RegEx, or do I have to go DOM?
- Next by Date: Re: Export local variable to global variable scope?
- Previous by thread: Re: Export local variable to global variable scope?
- Next by thread: Re: Export local variable to global variable scope?
- Index(es):
Relevant Pages
|