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 ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook