Justin Patrin wrote: > Benjamin Jeeves wrote: > >> Hi all, >> >> I have a search where I search inside a document and count how many times >> I found a given word. >> >> My problem is that I have a list e.g. $list_path this is a string of >> where the file is location on the server what I need help on this getting >> this list into array format of /somepath/doc1.doc would be $array[0] then >> /somepath/ doc2.doc would be $array[1] and so on. Then I can use >> array_count_values for how many times in appears. >> >> If I my going off can someone point me in the right way? >> >> >> Thank You >> >> Ben > > What format is $list_path in? How is it a string-list? If there is a > delimiter (; or , for example) you can us explode. > > $array_path = explode(';', $list_path); > I think the list is in scalar list e.g. if I print it as print ("$list_path[0] I get /home/user/index.php /home/user1/index.php /home/user2/index.php /home/user3/index.php and so on.
The only delimiter I can think of would to be explode on "/" and then rebuild all the path from the array. But was hoping for a butter way as not sure how to count all the values then? Thank you Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php