title: how to apply a text string in a variable with rename function
body: <p>When using the PHP rename function I need to use text in a variable in the rename, but I can only get the rename to work when I manually enter the text, for example</p>
  <p>If I use this</p>
  <pre><code>$original_file_name = '/my_file_path/Genesis _ Mad Man Moon _ A Trick Of The Tail (2007 Remaster) HQ Audio (128 kbps).mp3'; 
  </code></pre>
  <p>in rename like this</p>
  <pre><code>rename($filePath, $original_file_name); 
  </code></pre>
  <p>it works</p>
  <p>But if I do this</p>
  <pre><code>$a = &quot;'&quot;;
  $b = '/my_file_path/';
  $c = $fin_name;
  $original_file_name = $a.$b.$c.$a;
  </code></pre>
  <p>I get this</p>
  <pre><code>'/home2/ricstrav/domains/nerjabible.com/public_html/plupload_latest/Genesis _ Mad Man Moon _ A Trick Of The Tail (2007 Remaster) HQ Audio (128 kbps).mp3
  </code></pre>
  <p>'
  with the end quote spaced two lines down from the end of the line so it does not rename.</p>
  <p>Since I made this post, I have been thoroughly testing different options of rename, so far i have established the following</p>
  <p>I am using this line of code to rename a file that has been uploaded to my server rename(&quot;{$filePath}.part&quot;, $original_name);</p>
  <p>Where filePath is this file file_6278ea910fbf3 and the rename $original_name is the variable which contains the text ine below</p>
  <p>Genesis _ Mad Man Moon _ A Trick Of The Tail (2007 Remaster) HQ Audio (128 kbps).mp3</p>
  <p>when the rename fuction completes the file file_6278ea910fbf3 disappears off the directory on the server, but if I use this</p>
  <p>rename(&quot;{$filePath}.part&quot;, &quot;Genesis _ Mad Man Moon _ A Trick Of The Tail (2007 Remaster) HQ Audio (128 kbps).mp3&quot;);</p>
  <p>It works perfectly</p>
  <p>How can I make the variable $original_name reflect the same text, is there a 'normlising' option in php?</p>