If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
base64_decode() function, base64 encoded string को decode करता है।
base64_decode ( string $string , bool $strict = false );
string $string | required : base64 encoded string, जिसे decode करना है।
bool $strict = false | optional : strict parameter Boolean value true / false accept करता है। true का मतलब अगर input string में base64 alphabet के अलावा दूसरे characters भी हैं तो सिर्फ false return होगा otherwise उन characters को बाहर निकाल दिया जायगा। By Default false ही set होता है।
Return Value : successfully string decode होने पर decoded string return होगी otherwise false.
<?php $str = "SGVsbG8gd29ybGQgIQ=="; echo base64_decode($str); ?>Output
Hello world !
अब अगर इस encoded string में हम अपनी तरफ से कुछ add करें , तो base64_decode() function उसे evaluate नहीं करेगा।
<?php $str = "SGVsbG8gd29ybGQgIQ==1"; var_dump(base64_decode($str)); echo "<br>"; var_dump(base64_decode($str, true)); ?>Output
string(14) "Hello world ! " bool(false)
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook