WebP image is a popular image format using in web development. In this tutorial, we will discuss what its mime type is and how to output is to our browser using php directly.
Mime Type of WebP
To output it to browsers using php, you should do like:
Send a mime type header
<?php header("Content-Type: image/webp"); ?>
Read a webp image and output it
<?php echo file_get_contents($file); ?>
Then you will find this webp image appear in our browser.