Posted by Jerry Stuckle on 08/18/06 01:44
mens libertina wrote:
> Jerry Stuckle wrote:
>
>>mens libertina wrote:
>>
>>>After I read your post, I declared $info as "$info = array();" at the
>>>top of the program with the same result. Did I misunderstand what you
>>>meant by global scope?
>>
>>But now your problem is $info in the function is not the same as $info
>>in the main program.
>>
>>When declared as a parameter like this, $info is only local to the
>>function. Any other $info is completely separate from the one in the
>>function.
>
>
> Ugh. So if I can't pass by reference, what options do I have? It
> sounds like I can't use preg_replace anywhere but the main body...
>
> <about to throw mouse!>
>
No, you can also make it a global in the function and not pass it as a parm.
The one thing to remember - variable names in a function are only known
within that function. They can't be used outside of it.
Global variables can be used anyplace.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|