Last active
August 29, 2015 14:22
-
-
Save zahmaci/dbb0a5041eabde481ead to your computer and use it in GitHub Desktop.
Check if a string base64 encoded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_base64($str){ | |
if ( base64_encode(base64_decode($str, true)) === $str){ | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment