Home Backend Development PHP Tutorial 急怎么解决php GET 中文参数的有关问题

急怎么解决php GET 中文参数的有关问题

Jun 13, 2016 am 10:23 AM
get md quot urldecode urlencode

急!!如何解决php GET 中文参数的问题?
我如果 
?md=北海道

$md=$_GET['md'];

//$md=iconv("gb2312","utf-8",$md); 如果这里不转码,就只有 “北海”两个字,

但是这里如果 转码,

echo $md 就变得啥都没了,


求解决方法,我搜了整个百度,也就这个方法编码来实现了,但是现在这种情况我也不知道怎么好了!!

------解决方案--------------------
你的页面编码是? 用urlencode()编码后呢?
------解决方案--------------------
在传递参数页面对参数使用urlencode,获得参数时使用urldecode

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 urldecode() function: How to decode a URL-encoded string into a raw string and handle decoding errors PHP's urldecode() function: How to decode a URL-encoded string into a raw string and handle decoding errors Nov 03, 2023 pm 03:17 PM

PHP's urldecode() function was created in PHP4 and is a common URL decoding method. URL encoding is a method of converting non-English characters in a URL into special characters in order to transmit the URL to the server or otherwise process the URL. The urldecode() function restores these special characters to the original string. The syntax of this function is: stringurldecode(string$str) parameter str represents the character that needs to be decoded

How is the MD5 value of Douyin video generated? How is the MD5 value of Douyin video generated? Feb 19, 2024 pm 08:37 PM

What does Douyin video MD5 mean? With the rapid development of Internet technology, video sharing platforms have become an important way for people to obtain fresh information and entertainment. Among many video platforms, Douyin has quickly won the love and popularity of users around the world with its unique short video format and exciting content. Douyin’s video MD5 has also become one of the topics of interest and concern to many users. So, what exactly does Douyin video MD5 mean? First, we need to understand what MD5 is. MD5(MessageDigest

How to automate tasks using PowerShell How to automate tasks using PowerShell Feb 20, 2024 pm 01:51 PM

If you are an IT administrator or technology expert, you must be aware of the importance of automation. Especially for Windows users, Microsoft PowerShell is one of the best automation tools. Microsoft offers a variety of tools for your automation needs, without the need to install third-party applications. This guide will detail how to leverage PowerShell to automate tasks. What is a PowerShell script? If you have experience using PowerShell, you may have used commands to configure your operating system. A script is a collection of these commands in a .ps1 file. .ps1 files contain scripts executed by PowerShell, such as basic Get-Help

A guide to MD5 encryption techniques in PHP A guide to MD5 encryption techniques in PHP May 22, 2023 am 08:40 AM

PHP is a very powerful programming language that is widely used in the field of web development. As Web sites grow day by day, website security issues have become a factor that cannot be ignored in Web development. Among them, password security is the most important part. In order to protect user passwords, web developers often use encryption technology to encrypt and store passwords. MD5 is one of the commonly used encryption technologies. This article will focus on MD5 encryption technology in PHP. 1. Introduction to MD5 algorithm MD5 (Me

How does java initiate an http request and call the post and get interfaces? How does java initiate an http request and call the post and get interfaces? May 16, 2023 pm 07:53 PM

1. Java calls post interface 1. Use URLConnection or HttpURLConnection that comes with java. There is no need to download other jar packages. Call URLConnection. If the interface response code is modified by the server, the return message cannot be received. It can only be received when the response code is correct. to return publicstaticStringsendPost(Stringurl,Stringparam){OutputStreamWriterout=null;BufferedReaderin=null;StringBuilderresult=newSt

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

What is the length of the md5 value? What is the length of the md5 value? Feb 23, 2024 pm 02:06 PM

Title: What is the length of an MD5 value? Text: MD5 (MessageDigestAlgorithm5) is a commonly used hash algorithm that inputs a message of any length and produces a 128-bit (16-byte) hash value as output. The MD5 algorithm has the following characteristics: Fixed-length output: Regardless of the length of the input message, the MD5 algorithm can generate a 128-bit hash value no matter how long the input message is. This provides convenience for verifying data integrity by comparing different data

What is an MD5 hash value? What is an MD5 hash value? Feb 18, 2024 pm 08:50 PM

What is the MD5 value? In computer science, MD5 (MessageDigestAlgorithm5) is a commonly used hash function used to digest or encrypt messages. It produces a fixed-length 128-bit binary number, usually represented in 32-bit hexadecimal. The MD5 algorithm was designed by Ronald Rivest in 1991. Although the MD5 algorithm is considered no longer secure in the field of cryptography, it is still widely used in data integrity verification and file verification.

See all articles