mercredi 1 avril 2015

PHP how to count the length of each word in the text file

i need some help. how to count the length of each word in the text file using PHP.


for example. there is the test.txt. and the contain is " hello everyone, i need some help." how to output the text and then count the length of each word,like:


array



hello => 5
everyone => 8
i => 1
need => 4
some => 4
help => 4


i just start to learn php. so please explain the detail about the code what you write.


many thanks


Aucun commentaire:

Enregistrer un commentaire