Try to like This:
$input = " aa bb ";
$output = str_replace(" ","",$input);
echo $output;
Question
My script for showing the discount amount or percentage is;
function DisplayDiscount($value)
{
if (strstr($value,'%'))
$discount = "%".substr($value, 0, -1); //$discount = $value;
else
$discount = $value.SITE_CURRENCY;
return $discount;
}
Outcomes;
I want to eliminate the space between the value and XX but I could not figure it out.
Solution
Try to like This:
$input = " aa bb ";
$output = str_replace(" ","",$input);
echo $output;