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

換行源碼

發布時間: 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;
?>

熱點內容
虛擬機伺服器搭建ftp伺服器 發布:2025-05-12 00:37:04 瀏覽:291
hdp上傳 發布:2025-05-12 00:32:44 瀏覽:802
android卡刷包 發布:2025-05-12 00:26:45 瀏覽:278
bs管理系統源碼 發布:2025-05-12 00:25:39 瀏覽:839
zip解壓錯誤2 發布:2025-05-12 00:25:37 瀏覽:965
vb6編譯教程 發布:2025-05-12 00:09:37 瀏覽:917
安卓車機怎麼發送視頻 發布:2025-05-12 00:09:33 瀏覽:806
sql更新時間 發布:2025-05-12 00:02:27 瀏覽:651
安卓os系統怎麼刷 發布:2025-05-11 23:56:05 瀏覽:101
android非ui線程 發布:2025-05-11 23:51:53 瀏覽:568