@stefverniers then it is not a regular space but another character that looks like a space. Without the actual string I can't see which one works but try one of the following
Try appending this one; it removes the non breaking space: https://en.wikipedia.org/wiki/Non-breaking_space
$nospace = (string) str_replace(' ', '', $decodeprijs);
$nospace = preg_replace('/\xc2\xa0/', '', $nospace);
Or try one of these:
$nospace = preg_replace("/\s+/u", "", $decodeprijs);
// or;
$nospace = preg_replace("/[\pZ\pC]+/u", "", $decodeprijs);
An alternative approach is to simply remove everything except the characters you DO want to keep. So for example you could make a regex to remove everything except digits, comma, dot, minus and a euro and dollar sign.
$input = 'For Sale: € 999 , 9 9 ';
$output = preg_replace('/[^\d.,\-$€]/', '', $input)
$output = str_replace(',', '.', $output);
$output = str_replace('-', '0', $output);
// output = €999.99
But beware of this last approach that it could give strange results if you your input contains a value like: Buy 1, Get 2 for 4.50. The result would be 124.50.