PHP Classes
elePHPant
Icontem

Convert Ms Word to plaint text and count number of words: How to count word from plaintext

Recommend this page to a friend!
  All requests RSS feed  >  Convert Ms Word to plaint text and co...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Convert Ms Word to plaint text and count number of words

Edit

by Erick Mongi - 1 month ago (2017-05-04)

How to count word from plaintext

This request is clear and relevant.
This request is not clear or is not relevant.

+1

The main problems is how to count number of words from ms word 2007(docx format). Current I try to use doc2text to convert ms word to plaintext but display wrong number of words from plaintext that's main problem facing right now. If anyone knew how to count number of words direct from ms word using php library/ scripts that's all I need and helpful to my project. Thanks guys

  • 1 Clarification request
  • 1. by zinsou A.A.E.Moïse - 1 hour ago (2017-06-25) Reply

    Did the plaintext conversion contain the same text according to you? if yes then you can try to count the number of words from it.Otherwise you can use the alternative that you said. In every case, if your conversion succeed with the same text then you can use the package below to count number of words.

    Ask clarification

    1 Recommendation

    PHP String Foreach: Process strings as arrays of characters

    This recommendation solves the problem.
    This recommendation does not solve the problem.

    0

    by zinsou A.A.E.Moïse package author package author Reputation 1445 - 1 hour ago (2017-06-25) Comment

    First, you need to open the file to allow PHP use this ressource with a function like fopen;then you need to read the file with a function like fgets and affect its content to a variable then you can use the package like this to count number of words: This class got a method which allows to get an array of all the words in a string.The words are indexed so if you need to count them the first way is to see the last index and add 1 since PHP array start indexing at 0 or simply use the function count() of PHP on the array. You can also try https://www.phpclasses.org/package/9952-PHP-Manipulate-UTF-8-text-strings-in-pure-PHP.html


    Recommend package
    : 
    :