3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attr = '@C_1_2=Client'; $d = 'C_1_2: Client'; if (preg_match('/\@(.*)=(.*)/', $attr, $matches)) { // check corresponding values $tmp_attr = trim($matches[1]); $tmp_value = trim($matches[2]); if (preg_match("/$tmp_attr:$tmp_value/", $d)) { echo 'yes'; } }

preferences:
54.26 ms | 402 KiB | 5 Q