Re: Simple @#%@#% array/function not working....
| From: | Philip Olson | Date: | Sun, 11 May 2003 14:41:36 +0000 |
| Subject: | Re: Simple @#%@#% array/function not working.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147206@lists.php.net to get a copy of this message | ||
Read this:
http://www.php.net/variables.scope
Regards,
Philip
On Sun, 11 May 2003, Ryan A wrote:
> Hi,
> Am kind of new to php and brand new to arrays so please excuse me if this is
> a stupid way of doing things.
>
> I have an array and its working fine, but when i try to call a function that
> checks if the array isset i dont get the required output.
> Heres the code below:
>
> if (is_array($id)) { print "<pre>\$id = "; print_r($id); print
> "</pre>\n"; } //working fine
> $result = count ($id); //working fine
> print($result); //working fine
>
> function one()
> {
> if(isset($id[0]))
> return("test=".$id[0]);
> }
> echo "<h1>testing".one()."</h1>"; //HERES the problem, this is
> only
> printing "testing" instaed of "testing(array value)"
>
>
> Any ideas?
>
> Thanks in advance,
> -Ryan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>