Home >Backend Development >PHP Tutorial >Function code for converting html to txt text in php

Function code for converting html to txt text in php

WBOY
WBOYOriginal
2016-07-25 08:59:331114browse
  1. /**

  2. * Function to convert html to txt text
  3. * Edit bbs.it-home.org
  4. * at 2013/5/11
  5. */

  6. function html2text($str){

  7. $str = preg_replace("/