Introduction
In this article I describe the PHP string functions money_format, ln_langinfo and nl2br. To learn some other math functions, go to:
- String Functions in PHP: Part1
- String Functions in PHP:Part2
- String Functions in PHP:Part3
- String Functions in PHP:Part4
- String Functions in PHP:Part5
- String Functions in PHP:Part6
- String Functions in PHP:Part7
- String Functions in PHP:Part8
- String Functions in PHP:Part9
PHP money_format() Function
The PHP money_format function formats a number as a currency string.
Syntax
| money_format (string,number) |
Parameters in the money_format Function
The parameters of the money_format function are:
| Parameter | Description |
| string | It specifies the string to be formatted. |
| number | It specifies the number to be formatted. |
Example
An example of the money_format function is:
<?php
$number = 123467.89;
echo "$ ".number_format($number, 2);



Join the conversation! Your thoughts help the community grow.