I have a string and want to test using PHP if it\'s a valid base64 encoded or not.
base64_decode() should return false if your base64 encoded data is not valid.