Base64 fwrite using php

后端 未结 3 1965
北恋
北恋 2021-01-25 22:10

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         


        
3条回答
  •  再見小時候
    2021-01-25 22:44

    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.

提交回复
热议问题