this may sound stupid, but...

I am wondering if there is a simple way to set an array to seperate variable names? for example:

$inputarray[0] = "name=joe"
$inputarray[1] = "s=q73"
$inputarray[2] = "third=at noon"

what I am looking for in the end is:

$name=joe
$s=q73
$thir=at noon

if this makes sense?

    $name = input[0];
    $s = input[1];
    and so forth.

      redrage wrote:

      $name = input[0];
      $s = input[1];
      and so forth.

      I understand that could be done this way, but I need to find out if there is a way to do this dynamically, for example if I were to use the following as the method of obtaining the variable list:

      
      $basearray = explode('&', $_Server['QUERY_STRING']);
      

      which could end up with the array as in my original post,
      then take each array variable and bring it to it's own variable. I just need some guidance on how to do this, unless someone by chance has it done already.

      thx

        Ok. You want all $GETs to variables. I dont know why you even want to do that but here:

        if (!empty($_GET)) {
        	foreach ($_GET as $k=>$v) {
        		${$k} = $v;
        	}
        }
        

        But seriously.. Why not just use $_GET['varname'] instead of $varname?

          basically designing a fully "html form to database" type function. I know there are some out there, but want to do one myself.

          thanks though. 8-)

            Don't forget, in this way they could overwrite your own variables... you might want to prefix the incomming variables with something, like so:

            extract($_GET, EXTR_PREFIX_ALL, 'var_');

            With the above code, you would access all $GET indeces by prefixing the index with var, e.g. $var_user, $var_page, etc.

            If you didn't want to do that (though I would highly recommend it), you can simplify cahva's code like so:

            extract($_GET);
              Write a Reply...