Hey guys,
I want to use a PHP script to help determine the <base> for html output.
The variable I want to play with could be:
folder/blah.txt
or
folder/folder2/blah.txt
I want to be able to assign all text up to and including the last /, e.g.:
folder/
or
folder/folder2/
What is the best way to do this? I was thinking read each letter into an array, and check each array element from the end to the start until you find the first /. Then assign array[0] to array[num with /] to a variable.
Seems a looooong way to go about things, there must be a friendly way to use a php function to do this. Anyone have any ideas?