Q:

PHP program to convert base64 into the simple string

0

Here, we will convert a base64 into a simple string using base64_decode() function.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program/Source Code:

The source code to convert base64 into a simple string is given below. The given program is compiled and executed successfully.

<?php
//PHP program to convert base64 into the simple string.
$base64 = "d3d3LmluY2x1ZGVoZWxwLmNvbQ==";
$text = base64_decode($base64);
printf("Simple Text: [%s]", $text);
?>

Output:

Simple Text: [www.includehelp.com]

Explanation:

Here, we created a local variable $base64, which is initialized with "d3d3LmluY2x1ZGVoZWxwLmNvbQ==". After that, we converted the base64 into a simple string using base64_decode() function and then printed the simple text string on the webpage on the webpage.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now