The source code to convert the string into base64 is given below. The given program is compiled and executed successfully.
<?php
//PHP program to convert the string into base64.
$text = "www.includehelp.com";
$base64 = base64_encode($text);
printf("Base64: [%s]", $base64);
?>
Output:
Base64: [d3d3LmluY2x1ZGVoZWxwLmNvbQ==]
Explanation:
Here, we created a local variable $text, which is initialized with "www.includehelp.com". After that, we converted the string to base64 using the base64_encode() function and then printed the base64 value on the webpage on the webpage.
Program/Source Code:
The source code to convert the string into base64 is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we created a local variable $text, which is initialized with "www.includehelp.com". After that, we converted the string to base64 using the base64_encode() function and then printed the base64 value on the webpage on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer