Home > Backend Development > PHP Tutorial > php URL encoding and decoding function code

php URL encoding and decoding function code

高洛峰
Release: 2023-03-04 15:24:01
Original
1588 people have browsed it

<?php 
$url = "//m.sbmmt.com"; 
echo urlencode($url); //输出编码后的字符串 
?>
Copy after login
<?php 
$url = "//m.sbmmt.com"; 
$newurl = urlencode($url); //首先对$url进行编码 
echo urldecode($newurl); //输出解码后的字符串 
?>
Copy after login

For more articles related to PHP URL encoding and decoding function codes, please pay attention to the PHP Chinese website!


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