《PHP教程:php給每個段落添加空格的方法》要點(diǎn):
本文介紹了PHP教程:php給每個段落添加空格的方法,希望對您有用。如果有疑問,可以聯(lián)系我們。
本文實(shí)例講述了php給每個段落添加空格的辦法.分享給大家供大家參考.具體實(shí)現(xiàn)辦法如下:PHP學(xué)習(xí)
<?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程序設(shè)計(jì)有所贊助.PHP學(xué)習(xí)
維易PHP培訓(xùn)學(xué)院每天發(fā)布《PHP教程:php給每個段落添加空格的方法》等實(shí)戰(zhàn)技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培養(yǎng)人才。
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/11429.html