Re: Export local variable to global variable scope?



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 ::
---


.



Relevant Pages