xxxxxxxxxx
<?php
function stripper($element)
{
return trim($element); // this will remove the whitespace
// from the beginning and the end
// of the element
}
$myarray = array(" apple", "orange ", " banana ");
$stripped = array_map("stripper", $myarray);
var_dump($stripped);
?>