-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathacry.php
40 lines (39 loc) · 1.21 KB
/
acry.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$content = $acry_in;
if (strpos($content, "redirected from") === false) {
$needle = '<th>Definition</th>';
$pth = stripos($content, $needle);
if ($pth !== false) {
$pt = $pth + 14;
$out = substr("$content", $pt);
$pa = stripos($out, '</table>');
$out = left("$out", $pa);
$x = 0;
while (($aa = stripos($out, '<td class=acr>')) !== false) {
if ($x > 500) {
break;
}
$aend = stripos($out, '</td>', $aa);
$killer = substr($out, $aa, $aend - $aa);
$out = str_replace($killer, '', $out);
$x++;
}
$word = trim(strip_tags($killer));
$out = str_replace("</td>", '', $out);
$out = str_replace("</tr>", " \n", $out);
$out = strip_tags($out);
$out = $word . " may refer to :" . $out;
$acry_return = trim($out);
$files=DATA_PATH . "/acry/$global_id";
@unlink($files);
file_put_contents($files, $acry_return);
}
} else {
$acry_return = "";
}
if(!$acry_return && $expand_must){
$acry_return = "Sorry, no expansion found for " . strtoupper($word);
$to_logserver['isresult'] = 0;
$free = true;
}
?>