gpt4 book ai didi

php - html中的子字符串

转载 作者:行者123 更新时间:2023-12-04 05:49:50 25 4
gpt4 key购买 nike

<p style="color:red;font-size:12px;">This economy car is great value for money and with the added benefit of air conditioning is ideal for couples and small families. A ?500 excess applies which can be waived to NIL for only <b>5.00</b> per day</p>

使用以下2种方法
substr($mytext,0,25);


 $s = html_entity_decode($mytext);
$sub = substr($s, 0, 50);�

需要获得前 50 个字符...请大家帮忙

谢谢

最佳答案

希望这是有效的......试试吧

echo (substr(strip_tags($mytext), 0, 25));

http://www.ideone.com/6TgJX

关于php - html中的子字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10210630/

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