Solution? Apparently there is not a fast way, I'm fine with that. I am just learning php and I am trying to find out some good tips and tricks so that I do not get used to bad habit and waste time. I am passing values in a php script I am using $ _GET so that the URL looks like this: Now I know how to accept those values and keep them in this type of variable: < Pre> Super simple so far if I am passing 5-6, it can be disturbed and I do not like to type things for every single variable, this is the only reason. I know that there is a better way to do this. I have tried the I also tried Variable Variables like this: But he gave me a Any answer will be copied and paste in my question so that the next person will know: D Thanks guys! Your second bit of code is incorrect This should be If I understand your intentions, however, you are basically reinventing RegistryGlubels, which are ... .h which is unlikely to overwrite some important variables (whether it was due to accident or because there was a URL roaming around).
/poll_results.php?Sports=tennis& ; Cat = Sports & amp; question = Pick + your + favorite + sports
$ sports = $ _GET ['sports']; $ Cat = $ _GET ['Cat']; $ Question = $ _GET ['question'];
list ($ var, $ var, $ var) = $ _GET , but it does not work just with an indexed array (I think).
foreach (get $ $ as $ value) {$$ values = $ value; Resize $$ value; }
notice: undefined variable: value in poll_results.php at line 14. Line 14 is
$$ values = $ value. I do not know whether this is a big deal or not ... but I'm not turning off error reporting because I am in the process of creating a script. It does what I want to do ...
foreach ($ Key = & gt; $ value as $ _GET) {$$ key = $ value; }
foreach (array ('game', 'cat', etc.). If you want to get some variables, you can also do this. $ Key = $ _GET [$ key]; }
Comments
Post a Comment