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) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -