Skip to content

Instantly share code, notes, and snippets.

@zahmaci
Last active August 29, 2015 14:22
Show Gist options
  • Save zahmaci/dbb0a5041eabde481ead to your computer and use it in GitHub Desktop.
Save zahmaci/dbb0a5041eabde481ead to your computer and use it in GitHub Desktop.
Check if a string base64 encoded
<?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