J
J
JoenFun12020-05-17 12:13:46
PHP
JoenFun1, 2020-05-17 12:13:46

How to count the number of words in a file?

How to count the number of the same words in a txt file in php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Ivanov, 2020-05-17
@JoenFun1

Read the file (fread, etc.), get the line.
Split the string into separate words using the split method, then iterate through the resulting array and look for matches, then count these matches, that's all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question