-
Website Fastlinks
Domain Grapping Schnipsel -
More Links
Kostenloser Backlink
seo-attack.de Informationen zum thema SEO, SEM
kostenlose Informationen und beratung zum thema SEO, SEM für ihre Internetseite.
Reseller PHP Scripte
Projekte-Shop von official-reseller.com , ebooks, Fotos, Grafiken, Onlineshop, Templates, Webprojekte
Ergebnisse mit zwei stellen nach dem Komma
<?php
$d=50;
$c=2;
$quotient = $d / $c;
$ergebnis = sprintf("%01.2f", $quotient);
echo "Aufgabe: ".$d." / ".$c."<br>";
echo "Ergebnis: ".$quotient."<br>";
echo "Ergebnis mit 2 Nachkommastellen: ".$ergebnis;
?>
$d=50;
$c=2;
$quotient = $d / $c;
$ergebnis = sprintf("%01.2f", $quotient);
echo "Aufgabe: ".$d." / ".$c."<br>";
echo "Ergebnis: ".$quotient."<br>";
echo "Ergebnis mit 2 Nachkommastellen: ".$ergebnis;
?>
Randomize (Zufallszahlen)
<?php
$zufallszahl = "";
$stellen = 5;
mt_srand ((double)microtime()*1000000);
for ($i=0;$i<$stellen;$i++) {
$zufallszahl .= mt_rand(0, 9);
}
echo $zufallszahl;
?>
$zufallszahl = "";
$stellen = 5;
mt_srand ((double)microtime()*1000000);
for ($i=0;$i<$stellen;$i++) {
$zufallszahl .= mt_rand(0, 9);
}
echo $zufallszahl;
?>
Gerade oder Ungerade Zahlen:
<?php
$a=2;
$b=7;
if ($a % 2 != 0) { echo $a." : ungerade Zahl"; }
else { echo $a." : gerade Zahl"; }
echo "<br>";
if ($b % 2 != 0) { echo $b." : ungerade Zahl"; }
else { echo $b." : gerade Zahl"; }
?>
$a=2;
$b=7;
if ($a % 2 != 0) { echo $a." : ungerade Zahl"; }
else { echo $a." : gerade Zahl"; }
echo "<br>";
if ($b % 2 != 0) { echo $b." : ungerade Zahl"; }
else { echo $b." : gerade Zahl"; }
?>
Operatoren
<?php
$d=33;
$c=2;
$summe = $d + $c;
$differenz = $d - $c;
$produkt = $d * $c;
$quotient = $d / $c;
echo "Addition: ".$d." + ".$c." = ".$summe."<br>";
echo "Subtraktion: ".$d." - ".$c." = ".$differenz."<br>";
echo "Multiplikation: ".$d." * ".$c." = ".$produkt."<br>";
echo "Division: ".$d." / ".$c." = ".$quotient;
?>

