【发布时间】:2023-04-07 16:43:01
【问题描述】:
我通过 CURL 从网站获取文本,但它在原始网站的末尾有即使使用 str_replace、(string)、strval() 等也有帮助。
有人可以帮忙吗?
当前代码
$country = $s->fetchBetween('<dt>Country:</dt><dd>','</dd>', $result);
$country = strval($country);
$country = str_replace(" ", "", strval($country));
echo "start-{$country}-end";
exit;
我正在“冰壶”的网站上的值显示为
India
【问题讨论】:
-
只是出于好奇,你试过
trim()吗?