Re: Export local variable to global variable scope?
- From: howa <howachen@xxxxxxxxx>
- Date: Sun, 30 Sep 2007 00:30:04 -0700
And please don't top post. Thanks.
I am posting via Google Group, I am no control.
On 9 30 , 2 42 , Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
howa wrote:
On 9 29 , 9 10 , Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:you 'll have problems if you call the function twice.
howa wrote:
Hello,You should not have an include within a function call. Among other
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.
things, you 'll have problems if you call the function twice.
Actually, globals are bad things to use, anyway.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================
>
> this can be solved by using include_once.
>
> the reason of using function call to include is we want to selectively
> include the needed files, prevent include useless files (i.e. factory
> method?)
>
>
(Top posting fixed)
It isn't that much overhead to include an extra file or two. But if you
do that a lot, perhaps you should examine your methods.
And please don't top post. Thanks.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: Export local variable to global variable scope?
- From: Jerry Stuckle
- Re: Export local variable to global variable scope?
- From: Bruno Barros
- 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: Jerry Stuckle
- Re: Export local variable to global variable scope?
- From: howa
- Re: Export local variable to global variable scope?
- From: Jerry Stuckle
- Export local variable to global variable scope?
- Prev by Date: Re: Site preview with thumb
- Next by Date: Do you use _set?
- 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
|