3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = 'quick, brown" (for example), but not "quick and brown". So whe'; $test = "QUICK BROWN"; $temp = explode(" ", $test); $temp = array_map(function ($val) { return preg_quote($val, "~");}, $temp); $pattern = '~('.implode("[^A-Za-z0-9]+", $temp).')~i'; echo preg_replace( $pattern , '<span class="hilite">$1</span>', $source );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
166.29 ms | 2966 KiB | 13 Q