Home > Backend Development > PHP Tutorial > php除了字符串首尾中英文空格

php除了字符串首尾中英文空格

WBOY
Release: 2016-06-13 13:08:43
Original
916 people have browsed it

php去除字符串首尾中英文空格


/**
 * 去除空格(包括中英文空格)
 * User: yangyingjie
 * qq: 471156231 
 */
function  mbTrim($str)
{
    return mb_ereg_replace('(^( | )+|( | )+$)', '', $str);
}
Copy after login



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template