On Tue, May 21, 2002 at 08:03:36AM -0700, Rasmus Lerdorf wrote: > Depends a bit on what sort of globals you are after. If you mean a global > variable set by the user in the global symbol table you would do: > > pval **tmp; > if(zend_hash_find(&EG(symbol_table), "foo", 3, (void **)&tmp) == SUCCESS) { > RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); > } else { > RETURN_FALSE; > } > > Would fetch $foo from the global symbol table, stick it in tmp and return > it from your function.
I might be able to use this, but what I am really after is getting values from the session variables, like $_SESSION["id"]. Is this possible at all and if so, is this documented somewhere? > On Tue, 21 May 2002, Eric Veldhuyzen wrote: > > > Hi, > > > > I have just written a module for PHP (in C, linked with PHP statically). > > Now I need to access session variables and other globals from whithin my > > module. But I can't find how I should do this, I see documentation on > > how > > to call user functions, and how to create new global varables, but now > > how to access existing globals. Could somebody please tell me where > > tell me where this is documented if it is documented at all, or explain > > it to me if it is not documented yet? -- #!perl # Life ain't fair, but root passwords help. # Eric Veldhuyzen [EMAIL PROTECTED] $!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~ # Perl Monger /.(.)...(.)(.)....(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;` -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php