PHP urlencode vs. rawurlencode

1.rawurlencode the path

  • Path is the part before the “?”
  • Spaces must be encoded as %20

2. urlencode the query string

  •  Query string is the part after the “?”
  • Spaces are better encoded as “+”

3. rawurlencode is more compatible generally

Leave a Reply

Your email address will not be published. Required fields are marked *