User Tools

Site Tools


kurs:php9.7

Rückgabe in ein Array

<?php
$netto =200;
function MwSt($netto){
	$MwSt   = 0.2;
	$steuer = $netto*$MwSt;
	$brutto = $netto + $steuer;
	return array($steuer,$brutto);
};
$a_erg = MwSt($netto);
print("<table><tr><td>Netto</td><td align=right>$netto</td></tr>");
print("<tr><td>MwSt</td><td align=right>$a_erg[0]</td></tr>");
print("<tr><td height='1' colspan=2 bgcolor='000000'><img src='no.gif' height=1></td></tr>");
print("<tr><td>Brutto</td><td align=right>$a_erg[1]</td></tr></table>");
?>

Ausgabe

Netto 200
MwSt 40
Brutto 240
kurs/php9.7.txt · Last modified: 2014/09/10 21:22 (external edit)