How to append a value from php inside my JS file?
<p>Basically I want to read and write to a file then save all the compiled content another file.</p>

<p>Steps:</p>

<ol>
<li><p>Say I have a file <em>mycode.js</em> with this code:</p>

<pre><code>  var url = '';     //this will be field throug form in php
</code></pre></li>
<li><p>Now in php, I will input a value of that url e.g <code>www.google.com</code></p></li>
<li><p>How will I be able to append the url I just entered to my js file?<br>
Expected output:</p>

<pre><code>var url = 'www.google.com';
</code></pre></li>
<li><p>Also follow question, upon successful append of the value to my JS file I will now create a new file (<em>newlyappend.js</em>), like a save as thing. Where the content of the file is the newly append code:</p>

<pre><code>var url = 'www.google.com';
</code></pre></li>
</ol>

<p>Would like to achieve this using php.</p>
