Scripts

valuta euro formaat -> € 2 000,00

Voorbeeld: $bedrag = 2000; echo euro($bedrag); // Output: € 2 000,00 Makkelijk aan te passen (zie: http://www.phphulp.nl/php/tutorials/4/228/417/ ) *edit* verbeterde versie onderaan

valuta-euro-formaat--2-00000
<?php
function euro($s){
     if ((string)$s === "" ){
	return "-"; // Als geen input, print "-" naar scherm.
     }else{
	$s = sprintf( "€ %s", number_format($s,2,","," "));	 
	return $s;	
     }
}
?>

Reacties

0
Nog geen reacties.