关于php 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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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

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(): 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

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

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

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 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
