/**
* 将html内容转换为image图片
* @param $htmlcontent
* @param $toimagepath
* @author james.ou 2011-11-1
*/
public static function html2image($htmlcontent, $toimagepath, $toimagewidth = ‘400‘, $toimageheight = ‘300‘, $toimagetype = ‘png‘) {
$str = $htmlcontent;
$str = strtolower($str);
//$str = mb_convert_encoding($str, "html-entities", "utf-8");
//Get the original HTML string
//Declare
and
arrays$h1_start = array();
$h1_end = array();
//Clear
and
attributes$str = preg_replace("/
]*>/", "
", $str);
$str = preg_replace("/]*>/", "", $str);
$str = preg_replace("/
\s*/", "", $str);
//Declare arra