title: how to display an error message in an array
body: <p>i have this code:</p>
  
  <pre><code>$allowed_extension = array('jpg', 'jpeg', 'png', 'bmp', 'tiff', 'gif');
  $errors = array();
  $output = array();
  
  if(!empty($_FILES['image']['tmp_name'])){  
  
       foreach($_FILES['image']['name'] as $key =&gt; $array_value){
  
          if(!in_array(pathinfo($_FILES['image']['name'][$key], PATHINFO_EXTENSION), $allowed_extension)){
                  die("Die!");
          }
      }
  
      foreach($_FILES['image']['name'] as $key =&gt; $array_value){
  
         $file_name = $_FILES['image']['name'][$key];
         $file_size = $_FILES['image']['size'][$key];
         $file_tmp = $_FILES['image']['tmp_name'][$key];
  
         $file_extension = pathinfo($file_name, PATHINFO_EXTENSION);
         $file_extension = strtolower($file_extension);
  
           if (!in_array($file_extension, $allowed_extension)){
          $errors[$file_name][] = "format $file_extension in image $file_name is not accepted";
          continue;
           }
  
           if ($file_size &gt; 2097152){
          $errors[$file_name][] = "maxsize of 2MB on $file_name has reached";
                      }
  
           if (count($errors) == 0){
  
          $dir = "a/b/c";
  
          if (is_dir($dir)){
              mkdir("a/b/c/tmp_images", 0755);
          }else{
              mkdir("a/b/c", 0755);
              mkdir("a/b/c/tmp_images", 0755);
          }
  
          $path = "a/b/c/tmp_images"; 
          $prifix = basename($file_name, "." . $file_extension);
  
          //var_dump ($prifix);
  
          $uploadfile = $path . "/" . $file_name;
  
          $x = 0;
          while (file_exists($uploadfile)){
                 $x ++;
                 $uploadfile = "{$path}/{$prifix}-{$x}.{$file_extension}";
              }
  
              if (move_uploaded_file($file_tmp, $uploadfile)){
                 $file_name = basename($uploadfile);
                 $output [$file_name] = "OK";
  
              }else{
  
              $output[$file_name] = "Failure while Uploading!";
              $errors[$file_name][] = "Failure: Can't move uploaded pictures!";
              }//else...
           }//if(count($errors))...
      }//foreach($_FILES['image']['name']... 
  }//if(!empty($_FILES['image']['tmp_name'])... 
  </code></pre>
  
  <p>and my problem is, that i dont know how to display the error messages that should be shown, when the array</p>
  
  <pre><code>$errors
  </code></pre>
  
  <p>is given. up to now, it just will be displayed:</p>
  
  <pre><code>array
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>maxsize of 2MB on abc.jpg has reached
  </code></pre>
  
  <p>in the html i have this code:</p>
  
  <pre><code>&lt;?php if(isset($errors)):?&gt; 
  
      &lt;div class="form-error-message" id="signup-error-message" style="display": none;"&gt;
          &lt;div class="arrow-wrapper"&gt;
              &lt;div class="border-wrapper"&gt;
              &lt;?php foreach($errors as $error):?&gt;
                  &lt;p class="layer-content"&gt;
                  &lt;?php echo $error;?&gt;
                  &lt;/p&gt;
              &lt;?php endforeach;?&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  
  
  <p>if there is someone who could be that friendly and help me out i really would appreciate. thanks a lot.</p>