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

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -