php is similar to uriEncode in JS

WBOY
Release: 2016-08-08 09:30:13
Original
825 people have browsed it

     

Do not encode special characters in URI

$str = ';/?:@&=+$,#';
$urlencode = "%3B %2F %3F %3A %40 %26 %3D %2B % 24 %2C %23";

str_replace(array('%3A','%2F','%40','%3F','%3D','%26','%23','% 25','%3B','%2B','%24','%2C'), array(':','/','@','?','=','&', '#','%',';','+','$',','),$uri);

The above introduces how PHP is similar to uriEncode in JS, including aspects of it. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!