@ 2013-09-03T13:33:07Z <?php
$site_a['text'] = " wort 1 täglich wort 2";
preg_match('/<title>(.*?)<\/title>/is', $site_a['text'], $title);
if(isset($title[1])) {
$title = $title[1];
$title = preg_replace('/[^a-z0-9\.-üßäö]+/', ' ', $title);
}else
$title = "";
$site = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $site_a['text']);
$site = preg_replace('#<style(.*?)>(.*?)</style>#is', '', $site);
$site = preg_replace('#<a(.*?)>(.*?)</a>#is', '', $site);
$site = preg_replace('#<title(.*?)>(.*?)</title>#is', '', $site);
$site = strip_tags($site);
$site = preg_replace('/[\?]+\s/', '. ', $site);
$site = preg_replace('/[\!]+\s/', '. ', $site);
$site = preg_replace('/\s\s+/', ' ', $site);
$site = strtolower ( $site );
//$site = html_entity_decode($site, ENT_QUOTES, "UTF-8");
$site = html_entity_decode($site, ENT_QUOTES, "ISO-8859-1");
$site = preg_replace('/[^a-z0-9\.\?-üßäö\s]+/', ' ', $site);
$search = array("[", "]", "{", "}", ":");
$text = str_replace($search, "", $site);
$text = utf8_encode ($text);
$site = explode(". ", $text);
if(is_array($site))
foreach ($site AS $key => $satz){
$satz = preg_replace('/[^a-z0-9-üßäö]+\s/', ' ', $satz);
$satz = preg_replace('/[^a-z0-9-üßäö\s]+/', '', $satz);
$site[$key] = explode(" ", $satz);
}
$paragraph = array();
if(is_array($site))
foreach ($site AS $key => $satz){
$paragraph[] = array("sentence" => $satz);
}
$json = array("titel" => $title, "id" => "id", "link" => "link", "context" => array(array("paragraph" => $paragraph)) );
$json = json_encode($json);
print_r($json);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Deprecated: Function utf8_encode() is deprecated in /in/mjns4 on line 26
{"titel":"","id":"id","link":"link","context":[{"paragraph":[{"sentence":["","wort","1","t","glich","wort","2"]}]}]} Output for 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 {"titel":"","id":"id","link":"link","context":[{"paragraph":[{"sentence":["","wort","1","t","glich","wort","2"]}]}]} Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 Fatal error: Call to undefined function json_encode() in /in/mjns4 on line 53
Process exited with code 255 . Output for 4.4.5 - 4.4.9 Fatal error: Call to undefined function: json_encode() in /in/mjns4 on line 53
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.4 Fatal error: Call to undefined function: json_encode() in /in/mjns4 on line 53
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Process exited with code 139 . preferences:dark mode live preview
293.09 ms | 401 KiB | 460 Q