PHP money_format() Function

The money_format() function in PHP formats a number as a currency string and returns a formatted version of number.

Syntax

Parameter

format(required)- This parameter specifies the string to be formatted and how to format the variables in it.

number (required)- This parameter signifies the number to be inserted at the %-sign in the format string.

Return

This function returns the formatted string. It returns NULL and emits E_WARNING for Non-numeric number causes.

Example 1

Output

Example 2

Output

Example 3

Output

Pin It on Pinterest

Share This