I have two functions to format the result that I get from a table. I want to remove any leading and trailing spaces and also remove any HTML tags.
To remove the spaces I'm using this function:
To remove the tags I'm using this function:
For some reason the zeros in the text as also removed or not shown. Is there something in these functions that does that or is it likly it's being done somewhere else?
To remove the spaces I'm using this function:
Code:
function trim_value(&$value)
{
$value = trim($value, " , ");
$value = str_replace(" ", ' ', $value);
}
Code:
function tag_remove(&$value)
{
$value = strip_tags($value);
}
Comment