How to know if this code was executed correctly?
<p>Im using the following php code to upload an image to the server, the thing is I dont know how to make a "Success" or "Error" echo so I can handle each situation:</p>

<pre><code>&lt;?php
$msg = " ".var_dump($_FILES)." ";
$new_image_name = $_FILES["userfile"]["name"];
move_uploaded_file($_FILES["userfile"]["tmp_name"], getcwd() . "/images/" . $new_image_name);

?&gt;
</code></pre>

<p>This is the response array Im getting:</p>

<pre><code>["userfile"]=&gt;
  array(5) {
    ["name"]=&gt;
    string(15) "profile_698.jpg"
    ["type"]=&gt;
    string(24) "application/octet-stream"
    ["tmp_name"]=&gt;
    string(14) "/tmp/php0TFnhg"
    ["error"]=&gt;
    int(0)
    ["size"]=&gt;
    int(1361497)
  }
</code></pre>

<p>Thanks.</p>