print($tableau['cli_login'].$tableau['cli_name']'<br />'); }假如我想在每个login,name之间加n个空格,代码怎么打呢?谢谢
2 回答
慕妹3146593
TA贡献1820条经验 获得超9个赞
方法如下:
<?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 ) );
}
?>
- 2 回答
- 0 关注
- 198 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消