Moderator: lauras
echo date("H:i");
19:03 (Meine jetzige Uhrzeit)
echo date("H:i") ." Uhr";
19:03 Uhr
H = Stunde, nummerisch, 24-Stunden-Uhr
h = Stunde, nummerisch, 12-Stunden-Uhr
i = Minute, nummerisch
s = Sekunde, nummerisch
A = AM / PM
a = am / pm
echo date("H:i:s:A");
19:10:06:PM
echo date("h:i:s:a");
07:10:06:pm
echo date("d.m.Y");
20.04.2010 (ungefähr ;) )
d = Tag des Monats, nummerisch (01-31)
z = Tag des Jahres, nummerisch (001-366)
w = Wochentag, nummerisch, Sonntag ist 0 (0-6)
j = Tag des Monats, nummerisch (1-31)
m = Monat, nummerisch (01-12)
n = Monat, nummerisch (1-12)
t = Länge des Monates in Tagen (28,29,30,31)
y = Jahr, zweistellig (96, 67, 09)
Y = Jahr, vierstellig (1996, 1967, 2009)
Sonntag der 05. September 1867
$array_wochentage = Array
(
"0" => "Sonntag",
"1" => "Montag",
"2" => "Dienstag",
"3" => "Mittwoch",
"4" => "Donnerstag",
"5" => "Freitag",
"6" => "Samstag"
);
print_r($array_wochentage);
Array (
[0] => Sonntag
[1] => Montag
[2] => Dienstag
[3] => Mittwoch
[4] => Donnerstag
[5] => Freitag
[6] => Samstag )
$array_monate = Array
(
"1" => "Januar",
"2" => "Februar",
"3" => "März",
"4" => "April",
"5" => "Mai",
"6" => "Juni",
"7" => "Juli",
"8" => "August",
"9" => "September",
"10" => "Oktober",
"11" => "November",
"12" => "Dezember"
);
print_r($array_monate);
Array (
[1] => Januar
[2] => Februar
[3] => März
[4] => April
[5] => Mai
[6] => Juni
[7] => Juli
[8] => August
[9] => September
[10] => Oktober
[11] => November
[12] => Dezember
)
$wochentag = date('w'); // enthält jetzt eine zahl von 1 - 6
$wochentag_ausgeschrieben = $array_wochentage[$wochentag]; // $wochentag ist der index des arrays
print $wochentag_ausgeschrieben;
$tag_des_monates = date('d');
print $tag_des_monates;
$monat = date('n');
$monat_ausgeschrieben = $array_monate[$monat];
print $monat_ausgeschrieben;
$jahr = date('Y');
print $jahr;
$uhrzeit = date("H:i");
print $uhrzeit;
$datum = $wochentag_ausgeschrieben ." der ". $tag_des_monates ." ". $monat_ausgeschrieben ." ". $jahr ." ". $uhrzeit ." Uhr";
print $datum;
$array_wochentage = Array
(
"0" => "Sonntag",
"1" => "Montag",
"2" => "Dienstag",
"3" => "Mittwoch",
"4" => "Donnerstag",
"5" => "Freitag",
"6" => "Samstag"
);
$array_monate = Array
(
"1" => "Januar",
"2" => "Februar",
"3" => "März",
"4" => "April",
"5" => "Mai",
"6" => "Juni",
"7" => "Juli",
"8" => "August",
"9" => "September",
"10" => "Oktober",
"11" => "November",
"12" => "Dezember"
);
$wochentag = date('w'); // enthält jetzt eine zahl von 1 - 6
$wochentag_ausgeschrieben = $array_wochentage[$wochentag]; // $wochentag ist der index des arrays
$tag_des_monates = date('d');
$monat = date('n');
$monat_ausgeschrieben = $array_monate[$monat];
$jahr = date('Y');
$uhrzeit = date("H:i");
$datum = $wochentag_ausgeschrieben ." der ". $tag_des_monates ." ". $monat_ausgeschrieben ." ". $jahr ." ". $uhrzeit ." Uhr";
print $datum;
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5
$information = $_SERVER['HTTP_USER_AGENT'];
if(strpos($information, "Firefox") OR strpos($information, "Firebird"))
{
$browser = 'Firefox';
}
if(strpos($information, "Avant"))
{
$browser = 'Avant Browser';
}
if(strpos($information, "AppleWebKit"))
{
$browser = 'AppleWebKit';
}
if(strpos($information, "MSIE 5.0"))
{
$browser = 'Internet Explorer 5.0';
}
if(strpos($information, "MSIE 6.0"))
{
$browser = 'Internet Explorer 6.0';
}
if(strpos($information, "MSIE 7.0"))
{
$browser = 'Internet Explorer 7.0';
}
if(strpos($information, "MSIE 8.0"))
{
$browser = 'Internet Explorer 8.0';
}
if(strpos($information, "Netscape"))
{
$browser = 'Netscape';
}
if(strpos($information, "Camino"))
{
$browser = 'Camino';
}
if(strpos($information, "Galeon"))
{
$browser = 'Camino';
}
if(strpos($information, "Galeon"))
{
$browser = 'Galeon';
}
if(strpos($information, "Konqueror"))
{
$browser = 'Konqueror';
}
if(strpos($information, "Safari"))
{
$browser = 'Safari';
}
if(strpos($information, "OmniWeb"))
{
$browser = 'OmniWeb';
}
if(strpos($information, "Opera"))
{
$browser = 'Opera';
}
if(strpos($information, "Chrome"))
{
$browser = 'Google Chrome';
}
if(strpos($information, "Mozilla/5.0"))
{
$browser = 'Mozilla';
}
if
(
strpos($information, "Mozilla/4.0") OR
strpos($information, "Mozilla/3.0") OR
strpos($information, "Mozilla/4.8")
)
{
$browser = 'Netscape';
}
print $browser;
Google Chrome,
Firefox
$information = $_SERVER['HTTP_USER_AGENT'];
$betriebssystem = "Unbekannt";
switch ($information)
{
case strstr($information, "Win 95") OR strstr($information, "Windows 95"):
$betriebssystem = 'Windows 95';
break;
case strstr($information, "Win 98") OR strstr($information, "Windows 98"):
$betriebssystem = 'Windows 98';
break;
case strstr($information, "NT 4.0") OR strstr($information, "WinNT 4.0"):
$betriebssystem = 'Windows NT';
break;
case strstr($information, "NT 5.0") OR strstr($information, "WinNT 5.0"):
$betriebssystem = 'Windows 2000';
break;
case strstr($information, "NT 5.1") OR strstr($information, "WinNT 5.1"):
$betriebssystem = 'Windows XP';
break;
case strstr($information, "Mac"):
$betriebssystem = 'Mac OS';
break;
case strstr($information, "Linux"):
$betriebssystem = 'Linux';
break;
case strstr($information, "Unix"):
$betriebssystem = 'Unix';
break;
case strstr($information, "NT 6.0") OR strstr($information, "WinNT 6.0"):
$betriebssystem = 'Windows Vista';
break;
case strstr($information, "NT 6.1") OR strstr($information, "WinNT 6.1"):
$betriebssystem = 'Windows 7';
break;
}
Windows 7
print $betriebssystem;
$information = $_SERVER['HTTP_USER_AGENT'];
print $information;
$betriebssystem = "Unbekannt";
switch ($information)
{
case strstr($information, "Win 95") OR strstr($information, "Windows 95"):
$betriebssystem = 'Windows 95';
break;
case strstr($information, "Win 98") OR strstr($information, "Windows 98"):
$betriebssystem = 'Windows 98';
break;
case strstr($information, "NT 4.0") OR strstr($information, "WinNT 4.0"):
$betriebssystem = 'Windows NT';
break;
case strstr($information, "NT 5.0") OR strstr($information, "WinNT 5.0"):
$betriebssystem = 'Windows 2000';
break;
case strstr($information, "NT 5.1") OR strstr($information, "WinNT 5.1"):
$betriebssystem = 'Windows XP';
break;
case strstr($information, "Mac"):
$betriebssystem = 'Mac OS';
break;
case strstr($information, "Linux"):
$betriebssystem = 'Linux';
break;
case strstr($information, "Unix"):
$betriebssystem = 'Unix';
break;
case strstr($information, "NT 6.0") OR strstr($information, "WinNT 6.0"):
$betriebssystem = 'Windows Vista';
break;
case strstr($information, "NT 6.1") OR strstr($information, "WinNT 6.1"):
$betriebssystem = 'Windows 7';
break;
}
if(strpos($information, "Firefox") OR strpos($information, "Firebird"))
{
$browser = 'Firefox';
}
if(strpos($information, "Avant"))
{
$browser = 'Avant Browser';
}
if(strpos($information, "AppleWebKit"))
{
$browser = 'AppleWebKit';
}
if(strpos($information, "MSIE 5.0"))
{
$browser = 'Internet Explorer 5.0';
}
if(strpos($information, "MSIE 6.0"))
{
$browser = 'Internet Explorer 6.0';
}
if(strpos($information, "MSIE 7.0"))
{
$browser = 'Internet Explorer 7.0';
}
if(strpos($information, "MSIE 8.0"))
{
$browser = 'Internet Explorer 8.0';
}
if(strpos($information, "Netscape"))
{
$browser = 'Netscape';
}
if(strpos($information, "Camino"))
{
$browser = 'Camino';
}
if(strpos($information, "Galeon"))
{
$browser = 'Camino';
}
if(strpos($information, "Galeon"))
{
$browser = 'Galeon';
}
if(strpos($information, "Konqueror"))
{
$browser = 'Konqueror';
}
if(strpos($information, "Safari"))
{
$browser = 'Safari';
}
if(strpos($information, "OmniWeb"))
{
$browser = 'OmniWeb';
}
if(strpos($information, "Opera"))
{
$browser = 'Opera';
}
if(strpos($information, "Chrome"))
{
$browser = 'Google Chrome';
}
if(strpos($information, "Mozilla/5.0"))
{
$browser = 'Mozilla';
}
if
(
strpos($information, "Mozilla/4.0") OR
strpos($information, "Mozilla/3.0") OR
strpos($information, "Mozilla/4.8")
)
{
$browser = 'Netscape';
}
print '<p>Betriebssystem: <b>'. $betriebssystem .'</b></p>';
print '<p>Browser: <b>'. $browser .'</b></p>';
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; de_DE) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone2,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/4.0.1;FBSS/1; FBCR/Carrier;FBID/phone;FBLC/de_DE;FBSF/1.0]
Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_4 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8K2 Safari/6533.18.5
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0_1 like Mac OS X; de_DE) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.3;FBBV/4030.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0.1;FBSS/2; FBCR/Vodafone.de;FBID/phone;FBLC/de_DE;FBSF/2.0]
Mozilla/5.0 (Linux; U; Android 2.3.3; de-de; HTC_DesireS_S510e Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Mozilla/5.0 (Linux; U; Android 2.2.2; de-de; LG-P990 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MMS/LG-Android-MMS-V1.0/1.2
Mozilla/5.0 (Linux; U; Android 2.3.3; de-de; GT-S5830 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste