Forum Moderators: coopster

Message Too Old, No Replies

How to split a string

         

andrewsmd

8:57 pm on Jul 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am receiving an array of file names using the glob function. I need to split those strings based on their folder names. Can anyone tell me how to split the string on a \. i.e.
C:\testFolder\test.txt

I want to get an array that would look something like this
arr[0] = "C:"
arr[1] = "testFolder"
arr[2] = "test.txt"

Thanks

eelixduppy

8:59 pm on Jul 2, 2008 (gmt 0)




$pieces = [url=http://www.php.net/explode]explode[/url]('/', $file_path);

Try something like that :)