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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:50:37+00:00 2026-06-08T11:50:37+00:00

So I grab a string (usually an image location). Ideally, I would like it

  • 0

So I grab a string (usually an image location). Ideally, I would like it to always be

http://www.mydomain.com/images/cool-nifty-image.png

However, sometimes, it isn’t always like that. sometimes it’s

http://www.mydomain.com/images/cool-lame-image-300x300.png

with the 300×300 being relevant to the size. in the above example, I need the image located at

http://www.mydomain.com/images/cool-lame-image.png

(Yes, it ALWAYS exists.)

This would be easy it it was always triple digits. However, sometimes it can also be

    http://www.mydomain.com/images/cool-lame-image-300x99.png

or

    http://www.mydomain.com/images/cool-lame-image-99x99.png

Is there a way to find ” -#x#” so I can find -100×99 and -875×200?

  • 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-08T11:50:39+00:00Added an answer on June 8, 2026 at 11:50 am

    You’ll need a regex for this task

    $img = preg_replace('/-\d+x\d+(\.png)$/', '\1', $img);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to grab a json-string from this page: https://retracted.com If you view the
I need to grab a string like /html/body/a i need to check the last
i'm trying to grab a string like product/bob which works, but product/my%20first%20product does not.
I'd like to grab the users location as a co-ordinate and convert it to
I am trying to grab the string off an object in a table row
I need to grab the words out of this string and replace with AND
I'm trying to grab part of a string that represents a date. The date-string
I'd like to get a script that can grab the user's user agent and
I grab a JSON string from an API using jQuery's dataType 'jsonp'. The operation
I have a string 'some.file.name',I want to grab 'some.file'. To do that,I need 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.