Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
Class parser
{
var $template;
var $temp_content;
function parser($template, $var_array)
{
$this->template = $template;
$this->temp_content = file($this->template);
$parsed = $this->rplc($var_array);
echo(implode("", $this->temp_content));
}
function rplc($var_array)
{
foreach($var_array as $key => $value)
{
//$regex[var_name] : {VARIABLE}
$regex['var_name'] = "#{[[:space:]]*?(".strtoupper($key)."){1,}?[[:space:]]*?}#si";
$this->temp_content = preg_replace($regex['var_name'], $value, $this->temp_content);
}
}
}
?>
<?php
$fcontents = join ('', file ('http://www.heise.de/newsticker/heise.rdf'));
function shorter($out)
{
if(strlen($out)>35){$out=substr($out,0,100).'';}return htmlentities(stripslashes($out));
}
echo preg_replace("/((.*<\/channel>|)\s*(-|)\s*<item>\s+<title>(.+?)<\/title>\s+<link>(.+?)<\/link>\s*(<\/item>|)\s*(<\/rdf:RDF>|))/se","'<img src=\"r_pfeil.gif\" border=\"0\"> <a href=\"'.trim('\\5').'\"target=\"_blank\" onFocus=\"if(this.blur)this.blur()\">'.shorter('\\4').'</a> <br><br>'",$fcontents);
?>
ob_start();
include ("con_start.php");
$content = ob_get_contents();
ob_end_clean();
return $content;