-
I do see your point theTestingSite, but I still think it's advantageous. If you are only using the information for a short amount of time, and you have lots of it-- which appears to be the case in this script-- I don't see the problem. What's the difference in that and $var = $_POST['var'] ? Extract doesn't actually make them global does it?
-
If you look at the documentation on php.net (http://php.net/extract), you can see that it in fact does make it a "global" variable for the script/page that you send the data to.
Hope this helps.
-
Yes, it does make them global. Cluttering up the global namespace is always a bad idea, in any language. Generally you should try to have only necessary entry points in the global namespace. PHP's scoping system is pants, so there are quite a few cases in which it's necessary to make more global variables than should strictly be needed, but still you should avoid doing so where possible.
-
Thanks guys. I see the problem now. But, is there a way to do the same thing without global vars?