I am getting an Array out of a database and want to display it. This is my approach so far:
for ($i = 0; $i < count($results); $i++)
{
$output .= "<tr>
<td>".$results[$i]."</td>
</tr>";
}
print_r($output);
This works fine but the values inside the array look like this: "6.212,50"
So they are strings but I need to unformat them to do further calculations for that I use numeral.js which works like this:
numeral().unformat('6.212,50') //outputs 6212.50
How can I run this inside the PHP loop? I already tried this:
for ($i = 0; $i < count($results); $i++)
{
$output .= "<tr>
<td><script>numeral().unformat('$results[$i]')</script></td>
</tr>";
}
print_r($output);
But that displays nothing.