Jump to content

[SOLVED] Array Question


php-pendejo

Recommended Posts

Ok im using this code to debug and get all the globals that are posted on my site

$ArrayList = array("_POST", "_GET", "_COOKIE", "_ENV", "_FILES", "_SESSION", "_SERVER");
foreach($ArrayList as $gblArray) {
  $keys = array_keys($$gblArray);
  $DebugInfo .=  "\n Key: $gblArray - \n";
  foreach($keys as $key){
    @$$key = trim(${$gblArray}[$key]);
    if (is_array($$key)){
      for($i=0; sizeof($$key); $i++){
        $DebugInfo .=  "$key = ". @$$key[$i] . " \n";
      }
    } else {
      $DebugInfo .=  "$key = ". @$$key . " \n";
    }
  }
}

heres the delema. what i need is if $$key is an array to spit it out instead of saying its an array

 

can anyone help?

 

the way I am posting is

<select name="block[]" multiple>
<option value = 1> test1</option>
<option value = 2> test2</option>
<select>

or something like that 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.