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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:12:56+00:00 2026-05-24T02:12:56+00:00

I grab the URI string with php code. The URI could be: solution 1

  • 0

I grab the URI string with php code.
The URI could be:

solution 1 - http://www.site.com/one/two/
OR
solution 2 - http://www.site.com/one/two/var_abcdefg.html
OR
solution 3 - http://www.site.com/one/two/var_abcdefg.html?var=123456
OR
solution 4 - http://www.site.com/one/two/?var=123456

I would like to split the string in:

solution 1:
var 1 = "http://www.site.com/one/two/";
var 2 = "";
var 3 = "";
solution 2:
var 1 = "http://www.site.com/one/two/";
var 2 = "var_abcdefg.html";
var 3 = "";
solution 3:
var 1 = "http://www.site.com/one/two/";
var 2 = "var_abcdefg.html";
var 3 = "?var=123456";
solution 4:
var 1 = "http://www.site.com/one/two/";
var 2 = "";
var 3 = "?var=123456";

How I Can make 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-24T02:12:56+00:00Added an answer on May 24, 2026 at 2:12 am

    There is faster way:

    parse_url

    $input  = 'http://www.site.com/one/two/var_abcdefg.html?var=123456';
    $output = parse_url($input);
    
    array(4) {
      ["scheme"]=>
      string(4) "http"
      ["host"]=>
      string(12) "www.site.com"
      ["path"]=>
      string(25) "/one/two/var_abcdefg.html"
      ["query"]=>
      string(10) "var=123456"
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Nokogiri and open-uri to grab the contents of the title tag on
I am trying to grab a reference to images with src's in URI scheme.
To grab the inode of a file in PHP, you can use this: $fs
I want to grab the value of a hidden input field in HTML. <input
I'm trying to grab a div's ID in the code behind (C#) and set
I need to grab the URI of an iframe after load event. I have
So taking a look at the API doc page here: http://developers.facebook.com/docs/reference/javascript/FB.api I'm wondering if
How can I grab an HTML response when there are no response headers? I've
http://grab.by/1rI8 I wrote some jQuery script so that the background image will always scale
I grab a JSON string from an API using jQuery's dataType 'jsonp'. The operation

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.