String handling related to Problem preg_replace (), there was a strange substitution for Daniel to solve

Source: Internet
Author: User
String processing problem preg_replace (), there is a strange substitution, Daniel solve!
http://.com/item.htm?id=14135039282&ref=http%3A%2F%2Fsearch8.taobao.com%2Fsearch%3Fq%3D%25C4%25DA%25BF% 25e3%2b%25c4%25d0%26cat%3d50026972%26commend%3dall%26style%3dgrid%26ppath%3d2048150%253a105206%26cps%3dyes% 26pid

Above is the original string, why go through the following processing


', Htmlentities ($rw [' content '],ent_quotes,gb2312)])?>



After processing is shown like this, please note that after the number of the automatic line, there is no way to make sense
Http://.com/item.htm?
id=14135039282&ref=http%3a%2f%2fsearch8.taobao.com%2fsearch%3fq%3d%25c4%2

Also ask a question, the database is such a stored string
I
I
I
I

And after ', Htmlentities ($rw [' content '],ent_quotes,gb2312)]?> This process, it appears as follows
I
I
I
I

Why do you have to replace the space here, in the inner layer of the pattern to add \ nthe above situation will not appear

------Solution--------------------
No more solving, this is not a problem at all, even if Echo comes out directly,? The next line, the browser put the string between the question mark as a word processing, the word length of more than one screen to return line, with Word to edit the English language when the same effect, so it is only browser-related reasons
You can put a question mark in the following paragraph and adjust the width of the browser try
PHP code
 "!--? Phpecho" http://.com/item.htm?id=14135039282& ref=http%3a%2f%2fsearch8.taobao.com%2fsearch%3fq%3d%25c4%25da%25bf%25e3%2b%25c4%25d0%26cat%3d50026972% 26commend%3dall%26style%3dgrid%26ppath%3d2048150%253a105206%26cps%3dyes%26pid "; 
   
     
   
Related Article

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.