Can anyone find the solution for this error,
$str= trim(strip_tags($str));
$str = preg_replace("'<style[^>]*>.*</style>'siU",'',$str);
$patterns = array();
$patterns[0] = ' ';
$patterns[1] = ' ';
$patterns[2] = ' ';
$replacements = array();
$replacements[0] = '';
$replacements[1] = '';
$replacements[2] = ' ';
$str = preg_replace($patterns, $replacements, $str);
It showing this error.
Message: preg_replace() [function.preg-replace]: No ending delimiter ‘&’ found
-Arun
The first character in your pattern is interpreted as a delimiter and right now PHP thinks you want to use & as a delimiter. In your first regex, the delimiter was
', BTW. I guess what you really want is not' ', but'/ /'(e.g. for pattern 2), now/is the delimiter (it is not part of the regex itself). BTW, your first regex seems not correct either, it should probably beOtherwise the regex could match the first tag and the very last tag of the whole document.