I want to use fwrite to post $username in base64 encoded Here is my current source
$fp = fopen(\"id.txt\", \"a\");
fwrite($fp, \" $username\\r\\n\");
fclose($fp
Maybe I'm missing something but using the base64_encode function should work out nicely.
Or does:
$fp = fopen("id.txt", "a");
fwrite($fp, base64_encode($username) . "\r\n");
fclose($fp);
not work out for you?
To me it seems that it could.
I assume you want to store it encoded, use base64_encode.
fwrite($fp, base64_encode($username));
Did you try a Google search or reading the PHP documentation?
http://php.net/manual/en/function.base64-encode.php