您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php 怎么设置空格

2024/4/11 18:21:10发布18次查看
php设置空格的方法:1、创建一个php示例文件;2、通过“function white_space( $string, $whitespace ){...}”方法设置空格即可。
本文操作环境: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 ) ); }?>
推荐学习:《php视频教程》
以上就是php 怎么设置空格的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product