Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

php

Name: Anonymous 2007-08-18 18:51 ID:JGaBMBb2

How do I make an array from inside a function work outside it, I have tried
global $array
is there anything else i need to do to make it work?

Name: Anonymous 2007-08-18 18:57 ID:Heaven

pass by reference

Name: Anonymous 2007-08-18 18:57 ID:Heaven

I bet you got your tongue stuck on metallic objects during winters in your childhood. Multiple times.

Name: Anonymous 2007-08-18 18:58 ID:ynHS12D9

>>1
Return the array from the function, or define it in the function caller and pass it to the function as a reference. Or use a global variable, but avoid it if you can, unless you have a good reason to make it global.

If you're looking for closures, I'm afraid PHP doesn't have them.

Name: Anonymous 2007-08-19 0:22 ID:ZNf6d2Q5

Pass kidney stones by reference instead of value.  It hurts less.

Name: Anonymous 2011-02-03 5:01

Name: Anonymous 2011-03-31 12:09

I am the phantom autist

Name: Anonymous 2011-03-31 12:09

I am the phantom autist

Don't change these.
Name: Email:
Entire Thread Thread List