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.
$array = array(
'/' => 'sitename', // OK
'/start.php' => 'sitename', // OK
'/forum/main.php' => 'Forum', // OK
'/forum/showcat.php' => $forumcat['forumcat_name'],
'/forum/showthread.php' => str_replace('re:', '', $post_title),
'/guestbook/viewgb.php' => 'Gaestebuch', // OK
'/content/overview.php&type=2' => 'News-Archiv',
'contentid' => $contentinfo['content_title']
);
$suche = array('/include.php/', '/path=/', '/\?/');
$requestPath = preg_replace($suche, '', $_SERVER['REQUEST_URI']);
if( isset($array[$requestPath]) ) {
echo $array[$requestPath];
echo "<br>Pfad: ".$requestPath; //tmp Ausgabe
}
else {
echo "<br>ELSEpfad: ".$requestPath; //tmp Ausgabe
}
<?php
$array = array(
'/' => 'sitename', // OK
'/start.php' => 'sitename', // OK
'/forum/main.php' => 'Forum', // OK
'/forum/showcat.php' => $forumcat['forumcat_name'],
'/forum/showthread.php' => str_replace('re:', '', $post_title),
'/guestbook/viewgb.php' => 'Gaestebuch', // OK
'/content/overview.php&type=2' => 'News-Archiv',
'contentid' => $contentinfo['content_title']
);
$suche = array('/include.php/', '/path=/', '/\?/');
$requestPath = preg_replace($suche, '', $_SERVER['REQUEST_URI']);
if(strpos($requestPath, '&') === false) {
$path[0] = $requestPath;
} else {
$path = explode("&", $requestPath);
}
if( isset($array[$path[0]]) ) {
echo $array[$path[0]];
echo "<br>Pfad: ".$path[0] . $path[1]; //tmp Ausgabe
} else {
echo "<br>ELSEpfad: ".$path[0] . $path[1]; //tmp Ausgabe
}
?>
$array = array(
'/' => 'sitename',
'/start.php' => 'sitename',
'/forum/main.php' => 'Forum',
'/forum/showcat.php' => $forumcat['forumcat_name'],
'/forum/showthread.php' => str_replace('re:', '', $post_title),
'/guestbook/viewgb.php' => 'Gaestebuch',
'/content/overview.php&type=2' => 'News-Archiv',
'contentid' => $contentinfo['content_title']
);
$suche = array('/include.php/', '/path=/', '/\?/');
$requestPath = $_SERVER['REQUEST_URI'];
echo "Orig. Pfad: ".$requestPath;
$requestPath = preg_replace($suche, '', $_SERVER['REQUEST_URI']);
echo "<br>bearbeiteter Pfad: ".$requestPath;
if(strpos($requestPath, '&') === false) {
$path = $requestPath;
echo "<br>1: ".$path;
}
else {
$path = explode("&", $requestPath);
echo "<br>2: ".$path[0].$path[1];
}
if( isset($array[$path]) ) {
echo "<br>if: ".$array[$requestPath];
}
elseif ( isset($array[$path[0]]) || isset($array[$path[1]]) ) {
echo "<br>else: ".$array[$path[0]].$array[$path[1]];
}
else {
echo "else sitename";
}
Orig. Pfad: /
bearbeiteter Pfad: /
1: /
if: sitename
Orig. Pfad: /include.php?path=forum/main.php
bearbeiteter Pfad: /forum/main.php
1: /forum/main.php
if: Forum
Orig. Pfad: /include.php?path=forum/showcat.php&catid=35
bearbeiteter Pfad: /forum/showcat.php&catid=35
2: /forum/showcat.phpcatid=35
Warning: Illegal offset type in ... on line 138
else: 2.1 | Off-Topic
if( isset($array[$path]) ) {
Orig. Pfad: /include.php?path=content/overview.php&type=2
bearbeiteter Pfad: /content/overview.php&type=2
2: /content/overview.phptype=2
Warning: Illegal offset type in ... on line 138
else sitename
if(isset($array[$requestPath])) {
$path = $requestPath;
echo "<br>1: ".$path;
echo "<br>".$array[$path];
}
else { echo "<br>bla"; }