Marek Kilimajer wrote:
But workaround would be to call your function with array():
Thanks, I was afraid that might be the only way. I guess its possible
if you write an extension (like mysqli) in C?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Is there anyway to include a file inside of a function and have the included
stuff be global? For instance if I defined a class or a function in that
include file, I want to be able to use that class outside of the function.
On the documentation for include() a poster commented that it did
am I assuming correctly that get_defined_vars() returns an array pretty much
like the $GLOBALS array?
If I call extract() inside of a function, then the variables it creates will
be local to that function, correct? OK, so, is there a way to get extract()
to define those variables as global, from
Yes it is, you must tell the function to treat the relevant variables as
globals though, here is a way of doing it:
function Foo(){
$theArray = array('var1'='testing', 'var2'='testing2');
foreach($theArray as $varname=$value){
global $$varname;
}
extract($theArray);
}
On Fri, 12 Apr 2002, Aric Caley wrote:
but the virtual() documentation says you can't use it on a php script?
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I guess the only real way is to use virtual() in this case. That's
Is it possible to keep the variable name-space separate between, say, two
files (one included into the other) to avoid name collisions? I'm trying to
get two scripts to work together on the same page. Each script defines some
classes that have the same names but work differently (ex., class
ne class with the same name?
would be easier using different names for different classes.
or define a base class template
and extend it in the files as desired, but give them unique names.
how do you know later, which class does what in which way, when they have
the same
name. not very good imo.
Ar
as going through CGI or all the
way out to the port 80 level.
-Rasmus
On Fri, 12 Apr 2002, Aric Caley wrote:
Is it possible to keep the variable name-space separate between, say,
two
files (one included into the other) to avoid name collisions? I'm
trying to
get two scripts to work
If you register an object as a session variable, do you need to include the
objects class *before* start_session()?
What if I use serialize() on my object, and then register a variable with
the serialized data; then I can start_session(), do some other things, then
include the class definition,
maybe you could use eval():
eval(echo \$ . $field);
- Original Message -
From: Andy [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Tuesday, February 05, 2002 2:57 AM
Subject: Seams not to be possible
This was just an error in my explenation I ment categories.
I've used PHPShop (the existing version, not the new core/commerce thing) to
do one site.
It's relatively easy to set up. I've had to do some modifications to it
(namely, to make it use Payflow link, which works via HTTP requests; and
adding dropdown menus on products to select color airtime
Why, oh WHY doesnt this work.
I get the error:
Fatal error: Call to a member function on a non-object in
c:\home\digerati\www\classtest.php3 on line 23
If I try to make any assignments, anywhere, it dies. What the HELL is
going on? Obviously I must be missing something really obvious,
Is there any way to access the PHP4 session URL rewriter directly? Is there
a way to override it and use a different function (say you wanted to make a
rewriter for XML or something other than HTML)?
Could anybody point me to a function that does what the rewriter does?
Surely somebody's
13 matches
Mail list logo