I got the following problem: I got values like
2,50
1
2,99
Now I would like to separate them into 2 parts like this:
2 and 50
1 and 00
2 and 99
$euro = explode('.', $item->price)[0];
if(array_key_exists(1, explode('.', $item->price))) {
$cent = explode('.', $item->price)[1];
}
else
{
$cent = "00";
}
That's not the way I should do that I guess ;-)
There is another problem: Now I get the following values:
2 and 5
1 and 00
2 and 99
But it should be
2 and 50
1 and 00
2 and 99