PHP trim remove whitespace characters with specified characters _php tutorial

Source: Internet
Author: User
I haven't seen the trim function before, thinking that he can only delete white space, today it can also delete ""-null
"T"-tab
"N"-New line
"x0b"-Vertical list character
"R"-carriage return
""-Plain white space character
and user-specified characters oh.

$str = "# #使用函数trim去掉字符串两端特定字符 # # #;
$str 1 = Trim ($str, "#"); When you pass in the second parameter for function trim, Trim deletes the # character at both ends of the string $str
echo $str. "
";
echo $str 1;
?>

?>


http://www.bkjia.com/PHPjc/445376.html www.bkjia.com true http://www.bkjia.com/PHPjc/445376.html techarticle I've never seen the trim function think that he can only remove white space, today found it can also be deleted-null T-tab n-new line x0b-vertical list character R-carriage return-normal whitespace characters and user-specified ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.