How to insert Indian Rupees Symbol in PHP?

I want to know how to add new rupees symbol before the amount. This is my code below but it is not working

$number = 1234.65;
setlocale(LC_MONETARY, 'en_IN.UTF-8');
echo money_format('%n', $number);

This is original symbol **

**

The UtF-8 code for ₹ is ₹ . Try using that instead.

2 Likes

Hi there vijesharora16,

try it like this - ( decimal )…

<?php
   $number = 1234.65;
   setlocale(LC_MONETARY, 'en_IN.UTF-8');
   echo money_format('&#8377;%!n', $number);
?>

…or this - ( hex )…

<?php
   $number = 1234.65;
   setlocale(LC_MONETARY, 'en_IN.UTF-8');
   echo money_format('&#x20b9;%!n', $number);
?>

coothead

1 Like

Thanks mate, this works.

Thanks mate you too, this works.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.