Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:32:29+00:00 2026-05-28T00:32:29+00:00

I am using urls like this parameters http://localhost/articles/?author=Ben%20Cooper%2CAlex%20Hunter&title=…..&tags=.. I urlencode them in the links.

  • 0

I am using urls like this parameters

http://localhost/articles/?author=Ben%20Cooper%2CAlex%20Hunter&title=.....&tags=..

I urlencode them in the links. This all works until there are special characters in the parameters.

For example

http://localhost/articles/?author=..&title=&tags=..

If, in title I have Love & Life, first time it encodes it has Love+%26+Life, sometimes it becomes Love+%26amp%3B+Life.

Why is this happening? I appreciate any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:32:29+00:00Added an answer on May 28, 2026 at 12:32 am

    You need to use html_entity_decode() first. That will turn & (which is encoded for html, not urls) into & then unlencode() which will turn it into %26

    HTML and URLs have different reserved chars and are encoded differently. A lot of frameworks will automatically encode html entities to help prevent your page from rendering oddly. Imagine you had < in a string, that could screw up the page when it was displayed so it will get echo’d to the html as &lt; and the browser will render it as <instead of treating it as part of a tag.

    You can’t directly encode &lt; into %3C (< urlencoded) because it will think you literally want to encode &lt; and not < this is why you need to make a pass through html_entity_decode()

    Here is a code snippet:

    $str = 'Love &amp; Life'; //start with string that may or may not contain htmlentities
    $decodedStr = html_entity_decode($str); //replace html entities with their literal counterparts
    $urlEncodedStr = urlencode($decodedStr); //urlencode!
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[NOTE: I'm using ASP.NET MVC2 RC2.] I have URLs like this: /customers/123/orders/456/items/index /customers/123/orders/456/items/789/edit My
I have URLs like http://example.com/depict?smiles=CO&width=200&height=200 (and with several other optional arguments) My urls.py contains:
I have a website that has images with urls like this: http://mysite.com/image1.jpg My server
Are all URLs encrypted when using TLS/SSL (HTTPS) encryption? I would like to know
With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one
I'm having trouble with redirecting urls using the .htaccess file. This is what my
I need to test for general URLs using any protocol (http, https, shttp, ftp,
I understand how to use REST for doing general entity interactions - using urls
I'm using static URLs in my RoR project. There is really no controller or
I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.