I have some values in an array and I need to remove the blank spaces before them.
I've used
To trim the spaces using the function:
This seems to have no effect. I need to convert my values into an array of single characters. I don't have PHP 5 so I've used a function to do the same job as str_split.
However when I get the result for the blank space are not removed and for sections where I've used   it has changed it to which means I get wired looking symbols. Can anyone suggest what it happening?
I've used
Code:
array_walk($context_array, 'trim_value');
Code:
function trim_value(&$value)
{
$value = trim($value, "\xC2\xA0");
}
Code:
//This fuction is almost the same as the fuction str_split included in php5.
function strsplt($thetext,$num)
{
if (!$num)
{
$num=1;
}
$arr=array();
$xfive=floor(strlen($thetext)/$num);
while ($ifive<=$xfive)
{
$yfive=substr($thetext,$jfive,$num);
if ($yfive)
{
array_push($arr,$yfive);
}
$ifive++;
$jfive=$jfive+$num;
}
return $arr;
}
Comment