警告preg_match()分隔符不能是字母数字或反斜杠 - 无法修复[重复]

This question already has an answer here:

I keep getting this error, the error is in reference to this section of code, can someone tell me what I am missing:

if(!preg_match("class",$parameters)) $parameters .=" class='ibox'";

$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';

Thanks!

</div>

You are missing delimiters.

!preg_match("/class/", $parameters)

It would be much more efficient to use strpos in this case.

strpos($parameters, "class") === false

You can use

if( strpos($param, "class") === false ) {
    // do 
 }