gpt4 book ai didi

php - 警告 : preg_replace() [function. preg-replace]:C:\xampp 中的正则表达式为空

转载 作者:行者123 更新时间:2023-12-05 08:27:37 24 4
gpt4 key购买 nike

我正在尝试将数据输出到图表,但我在 preg_replace 语句上收到此错误。

ImageTTFText($this->img, $which_font['size'], $which_angle, 
$which_xpos, $which_ypos, $which_color, $which_font['font'], $which_text);
}
// Fixed fonts:
else {
// explode the text by its lines, and count them
$which_text = preg_replace("\r", "", $which_text);
$str = explode("\n", $which_text);
$nlines = count($str);
$spacing = $this->line_spacing * ($nlines - 1);

最佳答案

您的正则表达式是\r,这是无效的;您必须有开始/结束分隔符(例如,/)。尝试将其更改为 /\r/:

$which_text = preg_replace("/\r/", "", $which_text);

关于php - 警告 : preg_replace() [function. preg-replace]:C:\xampp 中的正则表达式为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35180397/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com