Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/08/2009, 11:02
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: REGEX (palabras completas)

Porque no usas mejor preg_match_all()
Código php:
Ver original
  1. <?php
  2. $key="word";
  3. $data="testing2.txt<br>The solutions that are currently available usually involve using binaries such as catdoc or antiword.  Good as these products are, they can be complicated to install and configure (sometimes impossible if using a shared hosting account).Heres a simple attempt at a solution using just PHP.
  4. I dont pretend that it makes a complete success of extracting the text from all Word documents, but Ive found it very reliable for the vast majority of the several thousand docs Ive used it with.
  5. The function returns text from the Word document as a string, with all the formatting removed.
  6. Please note that some parts of the Word document (header, footer etc) are not parsed.
  7. Y, 6Q";
  8. preg_match_all("/\b".$key."\b/i",$data,$m);
  9. print_r($m[0]);

Te va a traer 3 solamente.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos