before saying DUPLICATE, I found no correct answer in SO about my specific problem.
I know how to use base64_decode(). My problem is I need to check if a string is base64 to decode it, and if it's not, do nothing. The problem is some english strings like "hey guys"
are base64 valid, but will return pure crap.
echo base64_decode("hey guys");
will return (in latin1)
ì »+
Which is not what I want, I have a script looping throught strings in database checking for base64 and converting it. The problem is, the first time it will take "aGV5IGd1eXM="
and convert it to "hey guys"
and will redo it to "ì »+"
How can I check if it's real base64? Is there any way?