blob: 8b158b7aeb1b2ad7bf4d787f4cbe8ed95e7dda7c (
plain) (
blame)
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
|
<?php /** @file */
function string_splitter($s) {
if(! $s)
return array();
$s = preg_replace('/\pP+/','',$s);
$x = mb_split("\[|\]|\s",$s);
$ret = array();
if($x) {
foreach($x as $y) {
if(mb_strlen($y) > 2)
$ret[] = substr($y,0,64);
}
}
return $ret;
}
function get_words($uid,$list) {
stringify($list,true);
$r = q("select * from spam where term in ( " . $list . ") and uid = %d",
intval($uid)
);
return $r;
}
|