hi all,
i have a list like this
1,2,3,4,5
i want to take each item in the list and display in number format on a new line....for example
1.00
2.00
3.00
4.00
5.00
how can i do this?
list to array
Moderator: General Moderators
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
Hi,
Code: Select all
<?php
$numbers = "1,2,3,4,5,6";
$number_array = explode(',', $numbers);
foreach ($number_array as $number)
{
echo number_format($number, 2, '.', '') . "<br>";
}
?>