"Ray van Beek" <r_v...@ho...> writes:
(By the way: please subscribe to the list - postings from
non-subscribed addresses are held for approval until I either approve
them or rejects them.)
> Martin,
>
> I tried your suggestions but can't get it to work. I suspect the
> extract function
>
> function extract($array) {
>
> while (list($key, $val) = each($array)) {
> $GLOBALS["\"". $key. "\""] = $val;
> }
>}
Why have you wrapped $key in a pair of double quotes?
> I tracked the data from the METAR string to the extract function. I
> found that at a given iteration of the loop, the temp_c key is
> coming by. Then at the end of the function, I checked for a variable
> $temp_c but this results in nothing to be printed with:
>
> printf($temp_c);
>
> Is the $GLOBAL contruction
> correct for php3.0.3?
Well, I don't know? I was hoping that you could test that for me :-)
Try making a simple file like this:
function f($a) {
$GLOBALS['foo'] = $a;
}
f('Hello');
echo $foo;
That should print Hello, indicating that the function f is able to
access the global variables through $GLOBALS.
> By the way: I know that it would be best to ask the admin of the
> host provider to upgrade, I found out that my account is stored on
> some virtual server in a server farm. The company I obtained the
> account from only rents a virtual server, so I don't think that this
> company is able to upgrade php 3... unfortunately.
But... it's really easy to install PHP4 - if they managed to install
PHP3, then it shouldn't take them more that half an hour to install
PHP4... but on the other hand: I would like to support all possible
versions of PHP, so it's not all bad :-)
--
Martin Geisler My GnuPG Key: 0xF7F6B57B
See my homepage at http://www.gimpster.com/ for:
PHP Weather => Shows the current weather on your webpage.
PHP Shell => A telnet-connection (almost :-) in a PHP page.
|