Fixing Image upload, getting rid of Perl as such doesn’t solve the problem.
Stephan Froede

You are right: PHP works like PERL too!
With all due respect, I suggest (also, besides tips before) make a subroutine looking for “Magic number” at each file upped:

Like what you read? Give Jimmy Olano a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.