- var_dump: documentation ( source)
- str_replace: documentation ( source)
- array_walk: documentation ( source)
<?php
function trim_value(&$value)
{
$value = str_replace("\0", "", $value);
}
$fruit = array('apple','banana ', ' cran berry ');
var_dump($fruit);
array_walk($fruit, 'trim_value');
var_dump($fruit);
?>