You are here: Re: Export local variable to global variable scope? « PHP Programming Language « IT news, forums, messages
Re: Export local variable to global variable scope?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация