equal
deleted
inserted
replaced
21 * |
21 * |
22 * @param string $string |
22 * @param string $string |
23 * @param string $newlineEscape |
23 * @param string $newlineEscape |
24 * @return string |
24 * @return string |
25 */ |
25 */ |
26 public function _splitOnWords($string, $newlineEscape = "\n") { |
26 public function _splitOnWords( $string, $newlineEscape = "\n" ) { |
27 $string = str_replace("\0", '', $string); |
27 $string = str_replace( "\0", '', $string ); |
28 $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); |
28 $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); |
29 $words = str_replace( "\n", $newlineEscape, $words ); |
29 $words = str_replace( "\n", $newlineEscape, $words ); |
30 return $words; |
30 return $words; |
31 } |
31 } |
32 |
32 |