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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:18:11+00:00 2026-06-01T20:18:11+00:00

i have array with following strings. first im using explode \n and the output

  • 0

i have array with following strings.
first im using explode “\n” and the output as below.

[1]=> string(121) "/Microsoft/Windows/Ravemp2300Handler/DeviceArrival/a.exe" 
[2]=> string(139) "/Microsoft/Windows/EventHandlers/Ravemp2300Arrival/b.exe" 
[3]=> string(89) "/Microsoft/Windows/DeviceHandlers/Rio600Handler/c.exe" 
[4]=> string(103) "/Microsoft/Windows/Rio600Handler/EventHandlers/d.exe" 

the following array will be extracted a.exe, b.exe and so on as below.

[1]=> string(121) "a.exe" 
[2]=> string(139) "b.exe" 
[3]=> string(89) "c.exe" 
[4]=> string(103) "d.exe" 

anyone have idea how to solve the problem? i really appreciate it. thank you in advance.

i got the solution, thanks to Leven and Emil Vikström for alternate solution.

$array2 = array_map('basename', $array1);
  • 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-01T20:18:12+00:00Added an answer on June 1, 2026 at 8:18 pm

    You’re looking for basename():

    $array2 = array_map('basename', $array1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have the following array of strings: string[] stringArray = {"one", "two", "three",
I have the following code to populate an array of strings, but every time
I have the following issue related to iterating over an associative array of strings
I have the following string fromat: session=11;reserID=1000001 How to get string array of number?
I have two arrays, each containing strings. The first array is a list of
Have an issue with the following array... I can't navigate it using $arrayname[0]... it
I have a multi dimensional String array process[100][2] like following : Y B C
I have the following code function generate_pdf() { $fdf_data_strings = $this->get_hash_for_pdf(); #$fdf_data_names = array('49a'
I have the following string arrays: var array1 = new String[] { A, B,
I have following array, that I need to operate by hand on bitmaps. const

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.