本文操作环境:windows7系统、PHP7.1版、DELL G3电脑php 怎么设置空格?php给每个段落添加空格的方法本文实例讲述了php给每个段落添加空格的方法。分享给大家供大家参考。具体实现方法如下:<?php //Prep
本文操作环境:windows7系统、PHP7.1版、DELL G3电脑
php 怎么设置空格?
php给每个段落添加空格的方法
本文实例讲述了php给每个段落添加空格的方法。分享给大家供大家参考。具体实现方法如下:
<?php
//Prepends whitespace to each line of a string
function white_space( $string, $whitespace )
{
//Create an array from the string, each key having one line
$string = explode( PHP_EOL, $string );
//Loop through the array and prepend the whitespace
foreach( $string as $line => $text )
{
$string[ $line ] = $whitespace . $text;
}
//Return the string
return( implode( PHP_EOL, $string ) );
}
?>
--结束END--
本文标题: php 怎么设置空格
本文链接: https://www.lsjlt.com/news/583.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0