Basically what this needs to do is only accept a price value, that can only be 40 or 39.95 or 100.09 or 4 etc, if the user enters anything other than a digit into the field it comes back with an error.
My question: how can I change it so that if the user inputs a dollar sign in the input field that it just gets stripped out rather than returning an error in that particular case?
if (ereg_replace('/^\d+(\.\d{2})?$/', $_POST['itemAmt'])) {
echo '<h1>The original cost of the item: $' . $_POST['itemAmt'] . ' </h1>';
} else {
echo '<h1 style="color:red; font-weight:900;">The price value was not numeric, try again :) </h1><br>';
}