script >< link > tag is pulled out from the header of html contents. function get_mod_header($contents) { $pattern = "