tags:

views:

98

answers:

3

i have a need to get an undefined $_GET['$VARIABLE'].

so that if a link comes into item.php?changingitemstyle=10101010101010

I need to find out how to extract the name of the variable not the value.

Any ideas?

+5  A: 

Use the array_keys() function to retrieve an array of the keys of an array.

Gumbo
+1  A: 

figured it out

php function array_keys

mmundiff
+1  A: 

$_GET is a dictionary, so you can get the keys easily enough (unless I'm misunderstanding the question):

foreach( $_GET as $var_name => $value ) {
   // Do something here
}
Eric Petroelje
In PHP this data type is called associative array.
Gumbo