Home Backend Development PHP Tutorial escape and urldecode_PHP tutorial

escape and urldecode_PHP tutorial

Jul 13, 2016 am 10:58 AM
escape http urldecode but example and Comment

The example in the comments comes from http://cn.php.net/urldecode, but when the Chinese escape-processed string is executed this function, the returned Chinese UTF-8 encoding is returned.

function unicode_urldecode($url)
{
preg_match_all('/%u([[:alnum:]]{4})/', $url, $a);

foreach ($a[1] as $uniord)
{
$dec = hexdec($uniord);
$utf = '';

if ($dec < 128)
{
$utf = chr($dec);
}
else if ($dec < 2048)
{
$utf = chr(192 (($dec - ($dec % 64)) / 64));
$utf .= chr(128 ($dec % 64));
}
else
{
$utf = chr(224 (($dec - ($dec % 4096)) / 4096));
$utf .= chr(128 ((($dec % 4096) - ($dec % 64)) / 64));
$utf .= chr(128 ($dec % 64));
}

$url = str_replace('%u'.$uniord, $utf, $url);
}

return urldecode($url);
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631987.htmlTechArticle from http://cn.php.net/urldecode The example in the comment, but the Chinese version has been escaped If this function is executed on a string, the Chinese UTF-8 encoding will be returned. function unicode_urldecode($url...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Why is the latest comment on Xiaohongshu at the bottom? How does Xiaohongshu make its comments number one? Why is the latest comment on Xiaohongshu at the bottom? How does Xiaohongshu make its comments number one? Mar 21, 2024 pm 06:21 PM

As a popular social e-commerce platform, Xiaohongshu’s user comments are an important interactive link. Many users find that on Xiaohongshu, the latest comments often appear at the bottom of the comment area. Why is this? This article will delve into the sorting mechanism of Xiaohongshu’s comment area and share some tips for ranking comments at the front. 1. Why are the latest comments on Xiaohongshu at the bottom? The default sorting method of the Xiaohongshu comment area is to display comments in chronological order, that is, the latest comments will be displayed at the bottom of the comment area. This sorting method helps users easily view the latest comments and obtain real-time information. Xiaohongshu encourages interaction between users and encourages users to actively participate in comments by placing the latest comments at the bottom of the page. This design allows users to browse other users’ comments,

How do I delete my comments on TikTok? How can others find out my comments on TikTok? How do I delete my comments on TikTok? How can others find out my comments on TikTok? Mar 21, 2024 pm 10:41 PM

People enjoy posting videos, browsing videos, commenting and interacting on Douyin. But in the comment interaction, sometimes we may make some inappropriate remarks or make mistakes and want to delete these comments. So how to delete my own comments on Douyin? 1. How to delete my comments on Douyin? 1. Log in to Douyin App and find the video with the comment you want to delete. 2. At the bottom of the video page, find a list of all comments. 3. Find your comment, click the heart icon (like) on the right side of the comment, then click the delete icon (trash can) to confirm deletion. 4. If you @ other people in the comment, you will receive a prompt when deleting the comment: &quot;After deleting this comment, the person @ will not receive the notification.&quot; If you want the person @ to receive the notification, you can Cancel @ first,

Why is Xiaohongshu's own comment at the bottom? How to modify a comment on Xiaohongshu? Why is Xiaohongshu's own comment at the bottom? How to modify a comment on Xiaohongshu? Mar 21, 2024 pm 10:46 PM

Xiaohongshu is a popular social e-commerce platform where users can share shopping tips, recommend products and exchange shopping experiences. Some users found that comments they posted on Xiaohongshu were always displayed at the bottom, which confused them. This article will explore why Xiaohongshu’s comments arrangement causes user comments to appear at the bottom, and introduce how to modify the position of comments on Xiaohongshu. 1. Why are Xiaohongshu’s own comments at the bottom? The display order of comments on Xiaohongshu is usually based on the chronological order of the comments. If your comment is posted after another user has commented, it will appear at the bottom. This is Xiaohongshu’s default comment sorting method, which is designed to maintain order and clarity in the comment area. Xiaohongshu may based on the content of the comments

Why can't others see my comments on Xiaohongshu? Why can't others see its comments? Why can't others see my comments on Xiaohongshu? Why can't others see its comments? Mar 21, 2024 pm 07:51 PM

Xiaohongshu is a popular social media platform where users can share their lives and exchange experiences. Some users will find that when they comment on other people's posts, they cannot see it. So, why can’t others see my comments on Xiaohongshu? This article will explore this issue in detail to help you resolve your confusion. 1. Why can’t others see my comments on Xiaohongshu? Delayed review: Xiaohongshu review content has been reviewed and may be temporarily hidden due to containing sensitive words or illegal content. In this case, the other party may not be able to see the comment temporarily after it is posted. Generally, these comments will reappear once moderation is complete. Account anomalies may cause comments posted by commenters not to be seen by the other party, even if the comments are successfully posted. Such abnormal situations include accounts being banned or functions limited.

Why can't pictures be displayed in Xiaohongshu comments? Why is the Xiaohongshu IP address not updated? Why can't pictures be displayed in Xiaohongshu comments? Why is the Xiaohongshu IP address not updated? Mar 21, 2024 pm 09:00 PM

Xiaohongshu is a popular social e-commerce platform where users can share their shopping experiences and recommend products. Some users reported that they were troubled by the fact that the images they uploaded in their comments were not displayed properly. This article will help you find out why images in Xiaohongshu comments cannot be displayed and provide solutions. 1. Why can’t pictures be displayed in Xiaohongshu comments? Image formats may not be supported: Xiaohongshu’s comment function only supports limited image formats. If the image format you upload is not supported, the image may not be displayed. It is recommended that you try other formats, such as JPG, PNG, etc. The size of images uploaded in comments may be limited by Xiaohongshu. If the size of your image is too large, it may not be displayed properly. It is recommended that you try pressing

Will I be reminded if my Xiaohongshu comment is deleted by the blogger? What should I do if my comments in Xiaohongshu are deleted? Will I be reminded if my Xiaohongshu comment is deleted by the blogger? What should I do if my comments in Xiaohongshu are deleted? Mar 28, 2024 am 11:46 AM

Xiaohongshu is a content-rich and interactive social platform where users can post and comment on various contents. Sometimes we may encounter situations where our comments are deleted by bloggers. So, will the blogger be reminded if a Xiaohongshu comment is deleted? What should we do if it is deleted? 1. Will the blogger be reminded if a Xiaohongshu comment is deleted? After a Xiaohongshu comment is deleted by the blogger, the system will provide a notification to the user. Users can check the notification in Xiaohongshu’s message center to learn why their comments were deleted. Users can also find their deleted comments in the comment record on their personal homepage and view the relevant situation. 2. What should I do if my comments in Xiaohongshu are deleted? 1. Stay calm: First of all, we need to stay calm and don’t panic or get angry. Bo

How to pin comments to the top of Xiaohongshu on the computer? Where are the private messages on the computer? How to pin comments to the top of Xiaohongshu on the computer? Where are the private messages on the computer? Mar 28, 2024 pm 12:36 PM

On Xiaohongshu, users can browse a variety of beauty, fashion, travel and other content, while also expressing their own opinions and comments. Some users encountered the problem of how to pin comments when using the Xiaohongshu computer version. 1. How to pin comments to the top of Xiaohongshu on the computer? 1. Open the computer version of Xiaohongshu and enter the post or update you want to comment on. 2. In the comment area, find the comment you want to pin. 3. Click on the comment and you will see a "Pin" button. 4. Click the "Pin" button, and the comment will appear at the top of the comment area and become a pinned comment. It should be noted that the Xiaohongshu computer version currently only supports pinning your own comments, and the pinning function is only valid in the comment area of ​​posts or updates, and cannot be pinned on topic pages or global comment areas. two,

How to add people who comment on WeChat video accounts as friends? How do you know who the person who commented on the video account is? How to add people who comment on WeChat video accounts as friends? How do you know who the person who commented on the video account is? Apr 01, 2024 pm 05:06 PM

As the functions of WeChat video accounts continue to be upgraded, users have higher and higher requirements for the interactivity of video accounts. Among them, many people hope to find their favorite friends through comments and then add them as WeChat friends. So, how to add people who comment on WeChat video accounts as friends? 1. How to add people who comment on WeChat video accounts as friends? 1. Find the comments from your favorite friends. First, you need to find the comment in the WeChat video account that makes your heart move. This can be achieved by browsing the comment section of the video account. When you find an interesting comment, you can click on the commenter's avatar to enter his personal homepage. 2. Follow the video account and send a private message to the commenter's personal homepage. You can see their WeChat name and avatar. At this time, you can first follow the video account and then click

See all articles