I have a string and want to test using PHP if it\'s a valid base64 encoded or not.
I think the only way to do that is to do a base64_decode() with the $strict parameter set to true, and see whether it returns false.
$strict
true
false