<?php
// Gegeven: de prijs inclusief btw komt uit de database
$totaal = 49;
// Artikelprijs exclusief btw berekenen:
$prijs_exclusief_btw = round($totaal / 1.21, 2);
// Dan is de btw:
$btw = $totaal - $prijs_exclusief_btw;
// Hierna pas de getallen omzetten in strings:
$prijs_exclusief_btw = number_format($prijs_exclusief_btw, 2, ',', '.');
$btw = number_format($btw, 2, ',', '.');
$totaal = number_format($totaal, 2, ',', '.');
echo '<pre>';
var_dump($prijs_exclusief_btw, $btw, $totaal);
preferences:
37.46 ms | 402 KiB | 5 Q