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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:17:15+00:00 2026-05-19T22:17:15+00:00

i have this string: http://localhost/migo2/photo.php?id=68&a_id=83&p_id=349&type=1#p_id=302 and i would like to get the value of

  • 0

i have this string:

http://localhost/migo2/photo.php?id=68&a_id=83&p_id=349&type=1#p_id=302

and i would like to get the value of type (which is 1 obviously)

i do a

parse_str("http://localhost/migo2/photo.php?id=68&a_id=83&p_id=349&type=1#p_id=302");

and get

echo $type; -> 1#p_id=302

so i was thinking if i had a function that removed everything on the right side of # and the # itself i think i get what i want. Is this a bad way of doing it?

  • 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-19T22:17:15+00:00Added an answer on May 19, 2026 at 10:17 pm

    PHP has parse_url to parse the URL into components, then call parse_str only on the query string.

    $str = "http://localhost/migo2/photo.php?id=68&a_id=83&p_id=349&type=1#p_id=302";
    $parts = parse_url($str);
    parse_str($parts['query'], $arr);
    echo $arr['type'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this URL- http://localhost/app_demo/sample.php?jsonRequest={GenInfo:{type:Request,appname:XXX,appversion:1.0.0},searchDish:{userId:295,dishName:,est:Pizza &amp; Wings,location:,type:,priceRange:,deviceos:value,deviceId:<UDID>,deviceType:value,pageNo:1}} when I hit this URL and print
i have this URI. http://localhost/index.php?properties&status=av&page=1 i am fetching basename of the URI using following
I have this string: http://localhost/whatever/index.php/something/cms-abc.html?___SID=U I want to get the cms-abc from that string.
I have a url string like this: http://www.google.com/cse?cx=017840637368510444960:ny1lmky7r-0&client=google-csbe&output=xml_no_dtd&q=simon+g I need to send this url
I have this string: url(http:\/\/localhost\/cards\/media\/images\/designs\/backgrounds\/default\/1.jpg) now i want to remove url(http:\/\/localhost\/cards\/ The biggest issue
I have a URL like this: http://localhost:9001/view/shopindex/display?keyword=test&searchPostcode=Postcode and I'm putting it in the body
I have strings like this: http://localhost:2055/web-site-2009/paginas/noticias/**IGP-M recua 0,36% em agosto, aponta FGV**-46.aspx I'd like
I have this string: small: http://img.exent.com/free/frg/products/666550/player_boxshot.jpg boxshot: http://img.exent.com/free/frg/products/666550/boxshot.jpg I want to get only the
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to

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.