|
Posted by howa on 09/29/07 17:27
Assume that I know nothing about the stuffs inside bar.php...is it
possible?
On 9 29 , 9 49 , Bruno Barros <rage...@gmail.com> wrote:
> On 29 Sep, 13:23, howa <howac...@gmail.com> 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 ::
> ---
Navigation:
[Reply to this message]
|