The doctype is not constant.
That is the reason why I would like a regular expression.
I am trying
function get_doctype($file){
$h1tags = preg_match('/<!DOCTYPE (\w.*)dtd">/is',$file,$patterns);
$res = array();
array_push($res,$patterns[0]);
array_push($res,count($patterns[0]));
$res = preg_match('/XHTML 1.0 Strict/is',$res);
return $res;
}
in page with this doctype
But :
Warning: preg_match() expects parameter 2 to be string, array given in my_file.php
Thank you for replying!