title: PHP detect if file is webp image
body: <p>I'm trying to check if a file is a webp image in PHP</p>
  
  <pre><code>if (false != imagecreatefromwebp($filename)) {
              //do something
          }
  </code></pre>
  
  <p>But I get the following error</p>
  
  <pre><code>Warning: imagecreatefromwebp(): 'test.webp' is not a valid WEBP file
  </code></pre>
  
  <p>Same file can be successfully converted to jpg using online converts and
  I can also see that the file is actually a webp from the bytes</p>
  
  <pre><code>RIFF�5WEBPVP8X....
  </code></pre>