下面是我的字符串,使用imap从邮件服务器获取。
"i have string get from mail
Hello Everyone
I am comment from RTE
let me know about extra characters
Thank You"
答案 0 :(得分:0)
检查此代码。我认为它会对你有所帮助
<?php
$string = "let me know about extra characters ";
$string = str_replace(' ', '', $string);
echo $string;
echo "<br>";
// check 2
$string = "let me know about extra characters ";
$string = preg_replace("/\s| /",' ',$string);
echo $string;