prepareQuery(); $table = $config->sql_tablename_publish_de(); header("Content-Type: text/plain; charset=UTF-8"); header("Expires: on, 01 Jan 1970 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header('X-UA-Compatible: IE=edge,chrome=1'); header("Pragma: cache"); $re = '/# Split sentences on whitespace between them. (?<= # Begin positive lookbehind. [.!?] # Either an end of sentence punct, | [.!?][\'"] # or end of sentence punct and quote. ) # End positive lookbehind. (?prepare("SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC"); $stmt->execute(); while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) { $headline = $rows["post_title"]; $excerpt = $rows["post_excerpt"]; $linkingcode = $rows["guid"]; $sentences = preg_split($re, $rows["post_content"], -1, PREG_SPLIT_NO_EMPTY); echo "$headline###$excerpt###$linkingcode###$sentences[0] $sentences[1]\n"; } $stmt = null; // doing this is mandatory for connection to get closed $pdo = null; exit(0); ?>