Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 警告preg_match()分隔符不能是字母数字或反斜杠-无法修复_Php_Preg Match - Fatal编程技术网

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

Php 警告preg_match()分隔符不能是字母数字或反斜杠-无法修复,php,preg-match,Php,Preg Match,我一直收到这个错误,这个错误与这段代码有关,有人能告诉我我遗漏了什么吗: if(!preg_match("class",$parameters)) $parameters .=" class='ibox'"; $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"'; 如果(!preg_match(“class”,$parameters))$para

我一直收到这个错误,这个错误与这段代码有关,有人能告诉我我遗漏了什么吗:

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

$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
如果(!preg_match(“class”,$parameters))$parameters.=“class='ibox'”;
$field='您丢失了

在这种情况下使用它会更有效率

strpos($parameters, "class") === false
你可以用

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

谢谢,我会用什么来写这行:“echo$domain。preg_replace($search,$replace,$string);'因为它遇到了相同的错误。
$search
变量周围可能也没有像
/
这样的分隔符
if( strpos($param, "class") === false ) {
    // do 
 }