使用PHP函数preg_split()时出现这样的错误:Warning: preg_split() [function.preg-split]: Empty regular expression in D:\PHPServer\WEB\01\jpgraph\jpgraph.php on line 5782
代码function GetTextHeight($txt="",$angle=0) {
$tmp =preg_split("\n",$txt);
$n = count($tmp);
$m=0;
for($i=0; $i< $n; ++$i)
$m = max($m,strlen($tmp[$i]));
if( $this->font_family <= FF_FONT2+1 ) {
if( $angle==0 ) {
$h = imagefontheight($this->font_family);
if( $h === false ) {
JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.');
}
return $n*$h;
}
else {
$w = @imagefontwidth($this->font_family);
if( $w === false ) {
JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.');
}
return $m*$w;
}
}
else {
$bbox = $this->GetTTFBBox($txt,$angle);
return $bbox[1]-$bbox[5];
}
}
当年话下
蝴蝶不菲
慕容森
相关分类