문제

I'm doing a PHP project (using Codeigniter) on text summarization and for that I need to extract sentences from content of a Rich TextBox (this content includes tags). Therefore is there a proper method or Codeigniter library to extract sentences from a content containing HTML tags?

도움이 되었습니까?

해결책

A php function strip_tags() should help you. It returns string without php and html tags. If you just need to count sentences, you could do count(explode(". ", $text)) The delimiter is a typical end of a sentence.

Plain simple and limited, but doesn't require any libraries.

다른 팁

This technique is called as web-scraping

Have a look at this

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top