scottybwoy Posted February 21, 2007 Share Posted February 21, 2007 I use global quite a bit and thought I understood it. However When I call it in a function it seems to delete the contents let me show you how I'm utilising it: <?php function salesPrep($data_array) { global $data_array; echo '<u><b>$data_array</b></u><br>'; print_r($data_array); ?> I thought that would make it available to the code it returns too however it completely wipes the array. If I remove it, it works fine, but is not accessible to the rest of my code which I want, any pointers? Thanks. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 If you're passing $data_array, you don't also use global $data_array. Pick one or the other... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.