3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'PHP is a server side web programming language , PHP is amazing , I love PHP'; $array = array('html','css','javascript','ajax','html5','css3','jquery','PHP'); $escaped_array = array_map(function($value){ return preg_quote($value, '/'); }, $array); $regex = '/\b(' . implode('|', $escaped_array) . ')\b$/'; preg_match($regex, $string, $match); print_r($match);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
162.81 ms | 2300 KiB | 15 Q