Home Backend Development PHP Tutorial 关于php urlencode使用的有关问题

关于php urlencode使用的有关问题

Jun 13, 2016 pm 01:36 PM
cd quot urlencode

关于php urlencode使用的问题
$a = explode("|",'旺旺账号|旺旺账号|旺旺账号|旺旺账号');
echo urlencode($a[0]);

$a[0] 输出的值为:旺旺账号,正常的URL编码为:%cd%fa%cd%fa%d5%cb%ba%c5
但是上面代码得到的数值为:%CD%FA%CD%FA%D5%CB%BA%C5%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00
后面会出现很多%00这样的
这是为什么,正确应该怎么操作

------解决方案--------------------
啊,我的怎么是正常的呢?
旺旺账号的gbk编码下的urlencode就是%CD%FA0%CD%FA%D5%CB%BA%C5

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

PHP's urlencode() function: How to encode a string into a URL-safe format PHP's urlencode() function: How to encode a string into a URL-safe format Nov 03, 2023 pm 12:39 PM

PHP's urlencode() function: How to encode a string into a URL-safe format, specific code examples are needed. With the development of the Internet, URLs are widely used in daily life, and we often need to encode strings with some special characters into URL-safe formats. Format to pass parameters in the URL or request a web page. PHP provides the urlencode() function to accomplish this task. This article will introduce the usage of urlencode() function and give some specific code examples. 1. ur

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

How to use urlencode function to encode URL in PHP How to use urlencode function to encode URL in PHP Jun 26, 2023 pm 12:48 PM

In modern development, passing data through URLs is a common way. However, because the URL may contain some special characters, such as spaces, slashes, and question marks, these special characters will destroy the structure of the URL and cause data transmission to fail. In order to avoid this situation, PHP provides the urlencode function, which can encode the URL into a transportable format. The use of the urlencode function is very simple. Its syntax is as follows: stringurlencode(string

Introduction to PHP functions—urlencode(): encode URLs Introduction to PHP functions—urlencode(): encode URLs Jul 25, 2023 pm 09:25 PM

Introduction to PHP functions—urlencode(): Encoding URLs When developing web applications, you often encounter situations where URLs need to be encoded. URL encoding ensures that special characters in URLs are passed correctly, avoiding problems or incorrect results. In PHP, we can use the urlencode() function to perform URL encoding. The function of urlencode() function is to convert the string into an encoding format that conforms to the URL specification. It converts non-alphanumeric characters in a string to

An 8-year old operation and maintenance veteran was taught a lesson by a new intern An 8-year old operation and maintenance veteran was taught a lesson by a new intern Feb 20, 2024 pm 06:42 PM

Overview In Linux systems, it is very common to use the command line for file and directory operations. Among them, the cd command is one of the most commonly used and is used to switch between different directories. However, when you need to frequently switch between multiple directories, the cd command may seem a little inconvenient. At this time, the zoxide command comes in handy. Zoxide is a powerful tool that can automatically record and recommend directory paths based on users' habits and frequently visited directories, allowing users to locate the target directory more quickly. It provides a more intelligent and efficient directory navigation method by learning users' operating habits, allowing users to manage files and directories more easily. Through the zoxide command, users can quickly access the most commonly used directories without

Eight of the most commonly used Linux commands in DevOps Eight of the most commonly used Linux commands in DevOps Feb 19, 2024 pm 03:42 PM

DevOps engineers often rely on the Linux operating system. Proficiency in basic Linux commands is essential for efficient system management. This article will introduce the basic commands for using Linux in DevOps practice. 1 List files and directories: ‘ls’ command You can list files and directories in the current working directory using the ls command. Picture As you can see, you can use the command ls to display all directories and files in the current directory. To display detailed information about a file, use the -l option: Image When you use ls -l, you see detailed information about each file and directory, such as permissions, owner, group, size, and modification date. 2Change directory: cd command The cd command is used to navigate between directories. want

How to use urlencode function How to use urlencode function Nov 15, 2023 am 11:45 AM

Usage: 1. Used to encode dictionary; 2. Used to encode list; 3. Used to encode nested list; 4. Specify separator, etc.

How to use the urllib.urlencode() function to encode parameters in Python 2.x How to use the urllib.urlencode() function to encode parameters in Python 2.x Jul 29, 2023 pm 12:57 PM

How to use the urllib.urlencode() function to encode parameters in Python2.x During the programming process, we often need to interact with the server and pass parameters. In the process of passing parameters, we need to properly encode the parameters to ensure the correct transmission and parsing of data. Python provides the urllib library, in which the urlencode() function is a tool used to encode parameters. Let's take a look at Python2.x

See all articles