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 512435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:19:10+00:00 2026-05-13T07:19:10+00:00

someone here in SO told me that the hash (#) in the url could

  • 0

someone here in SO told me that the hash (#) in the url could be retrieved by php function parse_url? is this true?

my web site got a lot of ajax effects and i want to be able to pass an url with a hash to the index.php so it could display the information based on the hash values.

eg. if a user clicks and navigates in my website and he found a thing he wants to share, then he could copy the address and send it to his friend and when this person enters he sees the same thing.

i have tried using javascript to save the hash values in cookies but that isnt working with firefox and its too slow in safari (the html will show first, so one has to refresh the page a second time for the correct content to be shown).

any other solution is welcome

EDIT: im very confused..if i use the parse_url i have to type the url myself in php to get the hash? what is the point then…my question if whether my pal can enter the url with # values and php could process it? it seems like a no, am i right?

  • 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-13T07:19:11+00:00Added an answer on May 13, 2026 at 7:19 am

    parse_url() can get the hash from a url string. Note the signature:

    mixed parse_url ( string $url [, int $component = -1 ] )
    

    You must already know the string. For instance, from the docs:

    <?php
    
      $url = 'http://username:password@hostname/path?arg=value#anchor';
      print_r(parse_url($url));
      echo parse_url($url, PHP_URL_PATH);
    
    ?>
    

    Outputs

    Array
    (
        [scheme] => http
        [host] => hostname
        [user] => username
        [pass] => password
        [path] => /path
        [query] => arg=value
        [fragment] => anchor
    )
    /path
    

    Note the entry under key “fragment”.

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

Sidebar

Related Questions

Someone recently told me that this is bad: var el = $(#myID); $(el).addClass(a); $(el).addClass(b);
Ok, I know someone here has tried this ninja-elite level of coding before. Essentially
I'm staring blank on this error, so I hope someone here can point out
Okay, so I'm going to take the off chance that someone here has used
I can't see anything on here but I do remember being told that If
Someone told me that I need to use a delimiter in my trigger. I'm
Someone told me that when you killed a parent process in linux, the child
Has someone here ever had experience with the D programming language ? It seems
I'm hoping someone here can answer these definitively: Does putting a VHD file in
I hope someone here can help me.. I am currently having a small issue

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.