php - Subst a string reverse to the last slash -


Hello, I have a string with the path. I do not need the whole path to what substr Is possible in the last slash? Based on the code below, I do not need the model name .

Thank you for any indication you can give.

  $ path = userdir / modeldir / model name    

Try to blast the array by using slash as a delimiter?

  $ pathArray = explosion ('/', $ path);   

This should give you the entire folder tree as the array.

For more information see:

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -