encode()
encode(string $message) : string
Create the Base64 binary-safe representation of the given message.
The generated base64 is different from the stock PHP implementation as the generated string can be used on URLs.
The given message can be a binary unsafe string.
Example of usage:
//this is the binary unsafe message
$message = " ... ";
//print the result var_dump(Base64::encode($message));
Parameters
string | $message | the binary-unsafe message |
Throws
- \InvalidArgumentException
the given message is not represented as a string or the URL safety is not boolean
Returns
string —the binary-safe representation of the given message