Lines 1-6
Link Here
|
1 |
<?php |
1 |
<?php |
2 |
global $words; |
|
|
3 |
|
4 |
function mark_token_text($tokens, &$text) { |
2 |
function mark_token_text($tokens, &$text) { |
5 |
while ( list($idx, $token) = each($tokens) ) { |
3 |
while ( list($idx, $token) = each($tokens) ) { |
6 |
$safe_token = preg_replace(array('/\./', '/\-/'), array('\.', '\-'), $token); |
4 |
$safe_token = preg_replace(array('/\./', '/\-/'), array('\.', '\-'), $token); |
Lines 11-24
Link Here
|
11 |
} |
9 |
} |
12 |
function mark_token_html($tokens, &$text) { |
10 |
function mark_token_html($tokens, &$text) { |
13 |
$words = $tokens; |
11 |
$text = preg_replace_callback("/>([^<]+?)</", /* text between tags */ |
14 |
$text = preg_replace_callback("/>([^<]+?)</", //"mark_callback" |
12 |
function ($matches) use($tokens) { |
15 |
create_function( |
13 |
mark_token_text($tokens, $matches[1]); |
16 |
'$matches', |
14 |
return ">".$matches[1]."<"; |
17 |
'global $words; |
15 |
}, |
18 |
mark_token_text($words, $matches[1]); |
|
|
19 |
return ">".$matches[1]."<";' |
20 |
), |
21 |
$text); |
16 |
$text); |
22 |
} |
17 |
} |