3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($html) { $matched = preg_match('/<meta[^>]*name=[^>]*viewport[^>]*>/', $html, $matches); if (!$matched) { return false; } if (preg_match('/(user-scalable=(0|no)|scale)/', $matches[0])) { // 95% of the time this indicates true mobile compatibility (cf SYS-1289) return true; } if (preg_match('/width=(\d{2}|[7-9])\d{2}/', $matches[0])) { // Specifying a width of other 700px, doesn't sound very mobile compatible (cf SYS-1289) return false; } // At this point some websites are mobile compatible, others aren't, so we'll just go with the most likely return true; } var_dump(test('<meta content="width=1024" name="viewport"/>'));

preferences:
37.55 ms | 402 KiB | 5 Q