//preg_match_all('/<img[^>]+>/i',$content, $plaatjes);
$mystring = $content;
$findme = '(...)';
$pos = strpos($mystring, $findme);
if ($pos === false) {
$xp = strpos($mystring, "[...]");
$uitkomst = substr($mystring, 0, $xp);
if (empty($uitkomst )) {
$uitkomst = $mystring;
} else {
$uitkomst;
}
} else {
$pp = strpos($mystring, "(...)");
$uitkomst = substr($mystring, 0, $pp);
if (empty($uitkomst )) {
$uitkomst = $mystring;
} else {
$uitkomst;
}
}
$document = $uitkomst;
$search = array ("'<script[^>]*?>.*?</script>'si",
"'<[/!]*?[^<>]*?>'si",
"'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i");
$replace = array ("",
"",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169));
$texttt = preg_replace($search, $replace, $document);
$string = $texttt;
$overgeblevenwoorden =implode(" ", array_slice(preg_split("/\s+/", $string), 0, 53));
$postid = wp_insert_post(array(
'post_title' => $title,
'post_content' => $overgeblevenwoorden,
'post_content_filtered' => $overgeblevenwoorden,
'post_category' => $category,
'post_status' => $status,
'post_author' => $authorid,
'post_date' => $date,
'comment_status' => $comment_status,
'ping_status' => ($allowpings) ? "open" : "closed"
));