What is a valid jar file, as opposed to an ordinary zip file? The only difference I can find is that one has a .jar extension and the other has a .zip extension. unzip will quite happily unzip a renamed .jar file, and jar will quite happily extract a renamed .zip file.
(It's because the two archives have identical formats that either MIME type can be used; one is going by the file extension, the other by deducing the format.)
.jars usually have a Meta-inf directory with a manifest file in it; but if I recall rightly, jar gives the option of leaving that out.
But because the formats are identical, I guess you could use PHP's zip functions to examine the jar's contents (look for a Meta-inf directory, say).