Given a file:
Code: Select all
/opt/lampp/htdocs/test_12.htmlCode: Select all
/opt/lampp/htdocs/articles/some_terrible_page.html1) It's easy to read and understand
2) Fast and efficient
I've consider both comparing strings and as well as breaking them into arrays and comparing them iteratively that way.
I've been working on this for going on three hours now, so maybe I'm mush, but I've learned the following.
1) If the file path string length (minus the file name) is greater than the path string length, you can assume the file IS NOT inside the directory
2) If you stare at code for to long you begin to crazy and chew your nails.
So given the assesment or my understanding above, how would best implement this simple determination?
Cheers