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

  • Home
  • SEARCH
  • 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 8999317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:09:53+00:00 2026-06-16T00:09:53+00:00

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.

  • 0

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 tried:

/cms-.+/

But this will give me the stuff behind cms-abc as well. How do I solve this?

Thanks 🙂

  • 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-06-16T00:09:53+00:00Added an answer on June 16, 2026 at 12:09 am

    No need for regex:

    $url = 'http://localhost/whatever/index.php/something/cms-abc.html?___SID=U';
    $parts = parse_url($url);
    echo basename($parts['path']);
    

    or even just

    echo basename(parse_url($url, PHP_URL_PATH));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

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
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 this URI. http://localhost/index.php?properties&status=av&page=1 i am fetching basename of the URI using following
I have this url: http://localhost:8080/Test/jsp/index.jsp?userName=%E5%AE%98%E8%AF%9D . But when I tried to get the userName
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
I have this string in php i want to skip the ppattern ------------------------------------------ FROM:Andy;
I have this form : <form method='GET' name='search' action='index.php?explore=search'> <input type=hidden name=searchType value=all />
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 mootools request: new Request({ url: 'http://localhost:8080/list', method: 'get', }).send(); and a

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.