I want to get rid of the € sign here by using str_replace
$item['price'] = '200 €';
$item['price'] = str_replace('€', '', $item['price']);
So it should return '200' right?But it is still 200 €.. What am I doing wrong?
I want to get rid of the € sign here by using str_replace
$item['price'] = '200 €';
$item['price'] = str_replace('€', '', $item['price']);
So it should return '200' right?But it is still 200 €.. What am I doing wrong?
You can just filter the variable.
$item['price'] = filter_var($item['price'], FILTER_SANITIZE_NUMBER_INT);