0

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!

user1764987
  • 29
  • 1
  • 5

2 Answers2

1

You are missing delimiters.

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

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

strpos($parameters, "class") === false
Michal Brašna
  • 2,293
  • 13
  • 17
0

You can use

if( strpos($param, "class") === false ) {
    // do 
 }
Jignesh Patel
  • 1,028
  • 6
  • 10