2021年4月9日星期五

how to check if string is valid XHTML using PHP?

Using

    $html = '<br /><p>k</p>';  libxml_use_internal_errors(true);  $dom = New DOMDocument();  $dom -> loadXML($correo_elhtml);  echo '<pre>';  if(empty(libxml_get_errors())){      echo "This is a good HTML";      }  else {      echo "This not html";      print_r(libxml_get_errors());      }  

return ERROR, however that is a valid XHTML STRING.

Some function please?

https://stackoverflow.com/questions/67030152/how-to-check-if-string-is-valid-xhtml-using-php April 10, 2021 at 10:00AM

没有评论:

发表评论