What does this code mean? I haven't understood it for more than an hour. thank you!

Source: Internet
Author: User
What does this code mean? I haven't understood it for more than an hour. thank you! $ Patt = array ('/public','/index. php/Article/detail ',' _ CONTROL _ ',' _ WEB _ ','/index. php ');
$ Replace = array (' ',' ',' ',' ',' ');
$ Content = str_ireplace ('../public ',' ', $ Content );
$ Content = str_replace ($ patt, $ replace, $ content );


Reply to discussion (solution)

String replacement!
In $ content
/Replace Public
/Index. php/Article/detail
Replace _ CONTROL _
_ WEB _ replace
/Replace index. php
../Replace public

I cannot understand this. I should go back to the tutorial basics.

$ Replace = array (' ',' ',' ',' ',' ');

I have never written this way.

$ Replace = array (' ',' ',' ',' ',' ');

I have never written this way.

$ Replace = array (' ',' ',' ',' ',' ');
The red part is only the key value of the array.

Answer the LZ question. the str_replace parameter can be an array.

Thank you for understanding. it is really a beginner.

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.