當前位置:首頁 » 操作系統 » 換行源碼

換行源碼

發布時間: 2023-09-23 01:51:43

『壹』 求一段php源碼,要能根據字元串的長度自動為其換行!

<?php
$str="賣大米賣大米賣大米alf破爛換錢,大豆腐便宜啦,兩塊一塊dsjkal";
function addstr($str1,$len,$stradd="")
{
$i=0;
$str2="";
if($len%2==1)$len=$len+1;
$len1=strlen($str1);
for($i=0;$i < $len1/$len;$i++)
{
$str2.=substr($str1,$len*$i,$len).$stradd;
$str1=substr($str1,$len*$i,$len1-$len*$i);
}
return $str2;
}
$str3= addstr($str,6,"<br>");
echo $str3;
?>

熱點內容
安卓faceplay怎麼付款 發布:2025-09-16 03:32:34 瀏覽:581
安卓rom包里有什麼 發布:2025-09-16 03:07:57 瀏覽:350
sql2005無法連接 發布:2025-09-16 03:04:21 瀏覽:679
預埋件演算法 發布:2025-09-16 02:55:45 瀏覽:90
php取差集 發布:2025-09-16 02:46:58 瀏覽:971
ah腳本掃貨 發布:2025-09-16 02:44:53 瀏覽:70
加密相冊在哪裡找到 發布:2025-09-16 02:37:30 瀏覽:631
我的世界公益伺服器 發布:2025-09-16 02:26:18 瀏覽:832
我的世界對戰伺服器2021 發布:2025-09-16 02:13:05 瀏覽:742
蘋果店教編程 發布:2025-09-16 01:55:33 瀏覽:534