How to escape "#" character in URL using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amkohl
    New Member
    • Jul 2010
    • 10

    #1

    How to escape "#" character in URL using PHP

    We are using PHP framework to populate some dynamic values at page load. For this, we have implemented regex patterns in XML using PHP library to fetch some specific values from URL


    Like in URL below-

    http://<domain-name>/product-name/profile#/overview

    In this URL, whenever <product-name> AND <overview> is passed in the URL, by fetching these values using regex pattern in XML, wants to populate some dynamic values at page load.

    But it seems like the "#" sign in the URL is not being parsed.

    Please suggest me the correct pattern or let me know if I have missed anything.

    Appreciate all relevant inputs and earliest response.
  • zorgi
    Recognized Expert Contributor
    • Mar 2008
    • 431

    #2
    Did you try using urlencode and urldecode

    Comment

    Working...