ADVERTISEMENT
ADVERTISEMENT

PHP program to convert base64 into the simple string

Here, we are going to learn how to convert base64 into the simple string in PHP?
Submitted by Nidhi, on November 22, 2020

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

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.

More PHP Programs »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.