Can someone please tell me how to replace any code before a particular div, this is what i have so far:
$pattern1 = "/^<!doctype html>[a-zA-Z0-9._-]$/";
$replacement = '${1}1,$3';
preg_replace($pattern, $replacement, $ch);
I want it to replace absolutely anything it finds before a particular word which will be specified.