Basically I have the following string:
1,254.40
And I have to convert it into the following thing:
one * two * five * four * usd * four * zero * cents
How can I do that? So far I've written something like this:
public function priceToString($price)
{
$output = "";
$chars = str_split($price);
foreach($chars as $char)
{
if(is_numeric($char))
{
$output .= (string)$char . " *";
}
}
return $output;
}
But it doesn't work because it displays simply integers...How can I solve this?