Since echo
allows several parameters, it can be used as follows:
First form (commas and commas) :
echo "<div class=\"saldo\">", number_format($saldo, 2, ',', '.') ,"</div>";
Second form (quotation marks and periods) :
echo "<div class=\"saldo\">". number_format($saldo, 2, ',', '.') . "</div>";
Third (echo shortcut / short open tag) PHP> = 5.4.0:
<?=number_format(12930, 2, ',', '.');?>
The echo
, allows you to pass several parameters. The first form form would be the most common, because when you have several parameters, the normal is that they are separated only by commas, and in that case would be interpreted as a priority. But what should be taken into account is that echo
is not properly a function, but a constructor of the language itself.
The third approach does not have to be bound to echo
, simply abertura + variavel + fecho
.