PHP remove Chinese characters from string

WBOY
Release: 2016-07-28 08:29:59
Original
1679 people have browsed it

一The Chinese, delete a Chinese Chinese in the Chinese, as long as the Chinese characters are replaced in a regular way as an empty character:

<?php
header(&#39;Content-type:text/html;charset=utf-8&#39;);


function p($arr){
	echo "<pre class="brush:php;toolbar:false">";
	print_r($arr);
	echo "
"; } $a = "河蟹)(社会afeowa#$%^!@@#zf吃饭fawgwea汉堡包agho_iawghowi我日)"; $result = preg_replace('/([\x80-\xff]*)/i','',$a); p($result); ?>
Copy after login


The above introduces PHP to remove Chinese characters from strings, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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