$webp = strpos($_SERVER['HTTP_ACCEPT'], 'image/webp');
if ($webp == true) {
        //支持
} else {
        //不支持
}

WebP测试-及webp jpg png之间的对比

https://10.1pxeye.com/docs/webp-test/

相关文章
https://10.1pxeye.com/javascript%e5%88%a4%e6%96%ad%e6%b5%8f%e8%a7%88%e5%99%a8%e6%98%af%e5%90%a6%e6%94%af%e6%8c%81webp%e6%a0%bc%e5%bc%8f%e7%9a%84%e5%9b%be%e7%89%87/