Skip to content
Advertisement

How to remove unwanted characters/text – php

When I retrieve a file, it outputs:

...22nlarray(3) { [0]=> string(62) "/public_html/wp/wp-content/plugins/AbonneerProgrammas/Albums/." [1]=> string(63) "/public_html/wp/wp-content/plugins/AbonneerProgrammas/Albums/.." [2]=> string(69) "/public_html/wp/wp-content/plugins/AbonneerProgrammas/Albums/22nl.mp3" }

I, however, only want the 22nl displayed. I do not want the rest over there. How can I do that? Is there a function that deletes the rest of the output except 22nl (which is a filename)?

My PHP code:

JavaScript

There are similar questions to mine, however, they did not provide a good answer for me. Greetings,

Rezoo Aftib

Advertisement

Answer

We can say that your value from the array will be

JavaScript

So, you can make that to export your file name:

JavaScript

When you print $full_mp3_name you will need to have 22nl.mp3 When you print $just_name you will need to have 22nl

It will better with functions but its example if it will be option for you.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement