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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:17:14+00:00 2026-06-06T10:17:14+00:00

I have requests in a database from which I need to extract the name

  • 0

I have “requests” in a database from which I need to extract the name of the image – it will always be a .jpg but the number of characters in the name could vary, so I am shying away from substr().

The value looks like this “Added 545_4.jpg to Photo Album, The British Open”.

The “Added” will always be there and the “to Photo Album, ” will always be there but the name of the album differs.

Based on the manual I guessed that the % character means more than one character, so I tried to get that to represent the variants of photo albums. So, I ended up with this but nothing seemed to happen since it just echoes out the original string.

$emij = str_replace('Added','', 
        str_replace(' to Photo Album%', '', $thisTask[0]['request']));
echo $emij;

Any help is greatly appreciated.

  • 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-06T10:17:17+00:00Added an answer on June 6, 2026 at 10:17 am

    A regex will work best for this:

    preg_match("/Added (.*?) to Photo Album, (.*?)/",$thisTask[0]['request'],$m);
    // $m[1] is now the filename
    // $m[2] is the name of the album
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which requests information from several apis, some of them with
I have some application, which makes database requests. I guess it doesn't actually matter,
Here's my problem: In my database I have a requests table, which has a
I have two requests in tomcat. One HTTP request will create a thread. Client
I have a method which requests external webservices and returns json here: public string
I need to figure out how to best authenticate users which are connecting from
I am building a form in access database. I have a combo box which
I am building an application which will send status requests to users (via email
I have a WCF service that can receive several requests/minute (or seconds) that need
I have taken on a project from a client which requires me to set

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.