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);
You’re looking for basename():