Strict Standard erro in file upload
<p>I have written a PHP script to upload files. But when I press the submit button it gives an error message:</p>

<pre><code>Strict Standards: Only variables should be passed by reference in H:\xampp\htdocs\phpTest\upload_file.php on line 4.
</code></pre>

<p>line 4 is  $extension = end(explode(".", $_FILES["file"]["name"]));</p>

<p>upload_file.php:</p>

<pre><code>&lt;?php

$allowedExts = array("jpg", "jpeg", "gif", "png");
$extension = end(explode(".", $_FILES["file"]["name"]));
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&amp;&amp; ($_FILES["file"]["size"] &lt; 20000)
&amp;&amp; in_array($extension, $allowedExts))
  {
  if ($_FILES["file"]["error"] &gt; 0)
    {
    echo "Error: " . $_FILES["file"]["error"] . "&lt;br /&gt;";
    }
  else
    {

$target_Path = "images/";
$target_Path = $target_Path.basename( $_FILES['file']['name'] );
move_uploaded_file( $_FILES['file']['tmp_name'], $target_Path );


  echo "Upload: " . $_FILES["file"]["name"] . "&lt;br /&gt;";
  echo "Type: " . $_FILES["file"]["type"] . "&lt;br /&gt;";
  echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb&lt;br /&gt;";
  echo "Stored in: " . $_FILES["file"]["tmp_name"];
  echo $target_Path;
  }
  }
  else
  {
  echo "Invalid file";
  }
?&gt; 
</code></pre>
