title: rename file in php
body: <p>I want to rename <code>picture</code> filename (without extension) to <code>old.jpg</code> from this code.</p>
  
  <p>I have <code>picture</code> file in parent directory and the path is correctly</p>
  
  <pre><code>$old="picture";
  $new="old.jpg";
  rename($old , $new);
  </code></pre>
  
  <p>or this codes</p>
  
  <pre><code>$old="\picture";
  $new="\old.jpg";
  rename($old , $new);
  
  $old="../picture";
  $new="../old.jpg";
  rename($old , $new);
  
  $old="../picture";
  $new="old.jpg";
  rename($old , $new);
  
  $old="./picture";
  $new="./old.jpg";
  rename($old , $new);
  
  rename("picture", "old.jpg");
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code> Warning: rename(picture,old.jpg) [function.rename]: The system cannot find the file specified. (code: 2) in C:\xampp\htdocs\prj\change.php on line 21
  </code></pre>