equal
deleted
inserted
replaced
21 |
21 |
22 // save HTML tags |
22 // save HTML tags |
23 $text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE); |
23 $text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE); |
24 foreach ( $text as &$block ) |
24 foreach ( $text as &$block ) |
25 { |
25 { |
|
26 if ( strlen($block) < 1 ) |
|
27 continue; |
26 if ( $block{0} == '<' ) |
28 if ( $block{0} == '<' ) |
27 continue; |
29 continue; |
28 |
30 |
29 // split by words |
31 // split by words |
30 $block = preg_split('/(\s+)/', $block, NULL, PREG_SPLIT_DELIM_CAPTURE); |
32 $block = preg_split('/(\s+)/', $block, NULL, PREG_SPLIT_DELIM_CAPTURE); |