Special character escaping method in URL link

Source: Internet
Author: User
Tags php example
This article introduced the URL link in the special character escapes the method, learns the method of the escape character, has the need friend reference.

Special characters in URL addresses have special uses in URLs that cannot be passed directly to URLs, and URL encoding is required.

The encoded format is: The ASCII code of the% plus character, which is a percent percent, followed by the ASCII (16-binary) code value of the corresponding character. URL special characters need to be escaped 1, spaces replaced by plus (+) 2, forward slash (/) delimited directory and subdirectory 3, question mark (?) Separating URLs and queries 4, percent sign (%) make special characters 5, #号指定书签6, & separated parameters

URL special symbol and the corresponding hexadecimal value code: 1. The + sign in the + URL represents the space%2b2. Spaces in a space URL can be%203 with a + number or code. /delimited directory and subdirectory%2f4. ? Separates the actual URL and parameter%3f5. % specifies the special character%256. # indicates bookmark%237. The delimiter%268 between the parameters specified in the & URL. = The value of the specified parameter in the URL%3d

Functions for handling URL escape characters in JS escape, encodeURI, encodeuricomponentphp filter parameter special characters anti-injection PHP Methods for filtering illegal and special strings PHP Example: Special character handler example replace PHP code with special characters in extra long text

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.