<?php
$lowest_price = "$54.32";
$lowest_price = str_replace("$", "", $lowest_price); //price repair
for($i = 5; $i < strlen($lowest_price); $i++) {
$lowest_price[$i-5] = $lowest_price[$i];
}
// $lowest_price[strlen($lowest_price)] = 0;
$lowest_price = (float)($lowest_price);
echo $lowest_price;
Returns "54.32"
But if you set $lowest_price = "$432.10" it returns 232.10.
Ideas?
What is the point of the FOR loop? What are you actually trying to accomplish?