i need to remove whitespaces from the beginning and end of loop phrase
All words come from an loop, and look like this: " Hello all people "
I'm using the code -
$appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
foreach ($appliedFilters as $item) {
if ($item->getFilter()->getRequestVar() == 'b_car' || 'c_model' || 'd_year') {
$n_str = string.replace("\"", "", $item->getLabel()));
echo $n_str;
}
}
This code returns "Helloallpeople"
But i need "Hello all people"
Please help!
UPDATED
var_dump($item->getLabel()); returns string(7) "Hello " string(8) "all " string(5) "People "