How to cut the line from html the first 1,000 symbols



  • How do PHP cut the line, leaving only the first 1,000 symbols? The row contains HTML thetega and has to cut the row without the tags.(i.e. just substr, not suitable) That is, 1,000 symbols should remain text, and how many symbols HTML will not be important. ♪ ♪



  • There are several ways.

    1. Review the task, drain all html and cut

      $test = strip_tags($test); $test = substr($test,0,1000);

    2. Introduigating the description is allowed <cat> or bb-code and cut [cat]

    3. Cut not by symbols, but by number of words, for example, the condition that the Tag be shut down.

    You'll only be able to do a 1.2-v method, if you cut machines, you're likely to do 98%, and you'll be able to fix the tags for life.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2