你好,你能帮助我,我的问题有时会变化。
<?php
$ns = "test";
echo $ns;
打印测试,但我不想要这个。
输出
T:E:s:t中
请帮帮忙?
答案 0 :(得分:2)
chunk_split()函数拆分函数。
在我们的例子中,它按每1个字符分割。
并添加一个新字符:
。
我们不需要上一个:
字符,因此我们正在使用rtrim()。
<?php
$ns = "test";
$n = chunk_split($ns, 1, ':');
echo rtrim($n, ":");
?>
答案 1 :(得分:1)
请尝试以下代码:
entry.nomZone.replace(/\s/g,'');
答案 2 :(得分:1)
<?php $ns = "test";
echo substr(chunk_split($ns, 1, ':'), 0, -1);
?>