How to encode Base 64 in fput
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8062136/base-64-fwrite-using-php">Base 64 fwrite using php</a>  </p>
</blockquote>



<p>I want to base64encode $username in my code. Which uses fput.</p>

<pre><code>fputs($socket, "$username\r\n");
</code></pre>
