Categories: web development

Reserved Characters in URLs – PHP

These are list of following of reserved characters for links:

! # $ % & ( ) * + , / : ; = ? @ [ ]

These characters need to be encoded so it doesn’t interfere with the function of the URL.

These characters will turn into %21 hexadecimal characters.

A fix for this is

<?php
 urlencode($string);

?>

 

URLencode

  • Letters, numbers, underscores, and dash are unchanged
  • Reserved characters become % + 2 digit hexadecimal
  • Spaces become “+”
  • Use this for query string after that ?

rawurlencode

  • rawurlencode should only be used for file path
  • path is the part before “?”
  • spaces must be %20
  • it’s newer
Admin

Share
Published by
Admin
Tags: phpurlencode

Recent Posts

Unveiling the Intricacies of the Tinder Algorithm: 5 Surprising Metrics

Monitored by Tinder The inner workings of the Tinder algorithm remain shrouded in secrecy, known…

3 weeks ago

Is Shopping Temu Safe

Use fav19073 30% OFF Shop Now I recently had a fantastic buying experience on Temu,…

4 months ago

Cheap Netflix Subscription

Unlocking Affordable Streaming: How Gamsgo.com is Revolutionizing Netflix Subscriptions Sign Up Save1 coupon code for…

4 months ago

Domains for SALE.

razerkeyb.com gloriousmouse.com

9 months ago

How to Start your own vegetable garden?

Planting your own vegetables and fruit is a great way to save money and eat…

1 year ago

Jobs AI can’t replace

While AI has the potential to automate many tasks, there are still some jobs that…

1 year ago