正则替换全角字符
Release: 2016-05-25 17:13:44
Original
1723 people have browsed it
php代码
1 2 3 4 5 | function zo_replace(text) {
return text && text.replace(/[\u3000\uff01-\uff5f]/g, function ( $0 ) {
return $0 == "\u3000" ? " " : String.fromCharCode( $0 .charCodeAt(0) - 0xfee0);
});
}
|
Copy after login
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
Latest Articles by Author
-
2024-12-12 11:03:15
-
2024-12-12 11:01:15
-
2024-12-12 10:59:13
-
2024-12-12 10:58:16
-
2024-12-12 10:57:14
-
2024-12-12 10:56:12
-
2024-12-12 10:55:13
-
2024-12-12 10:54:17
-
2024-12-12 10:53:16
-
2024-12-12 10:51:16