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

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

WBOY
WBOYOriginal
2016-06-13 13:08:43863browse

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


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



Statement:
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