White space character conversion problems

Source: Internet
Author: User
White space conversion & lt ;? Echo $ _ POST ['AAA']. '& lt; br & gt;'; functionhtmlpost ($ x) {$ x1 = array (''); $ x2 = array (& quot; & amp; nbsp; & quot;); $ x = str_replace ($ x1, $ x2, $ x); reblank character conversion problem
Echo $ _ POST ['AAA'].'
';
Function htmlpost ($ x ){
$ X1 = array ('');
$ X2 = array ("");
$ X = str_replace ($ x1, $ x2, $ x );
Return $ x;
}
Echo $ _ POST ['AAA'] = htmlpost ($ _ POST ['AAA']);
?>


Enter two or more consecutive blank characters in the input box.
There is no problem when submitting for the first time. the white space character can be converted, but the white space character is not converted
What is the reason?

------ Solution --------------------
Utf8

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.