Can this PHP code be improved?
<p>Is there a better way to do this simple task below?  Like with an array or even another method?</p>

<pre><code>&lt;?PHP
// current way
if ($city != NULL) {
    $city = FilterALLHTML($city);
}
if ($state != NULL) {
    $state = FilterALLHTML($state);
}
if ($title != NULL) {
    $title = FilterALLHTML($title);
}
if ($division != NULL) {
    $division = FilterALLHTML($division);
}
?&gt;
</code></pre>

<p>Here is my current function</p>

<pre><code>function FilterALLHTML($document) {
    //old array line //"'&lt;[\/\!]*?[^&lt;&gt;]*//?//&gt;'si",// strip html
    $text = strip_tags($document);
    $search = array ("/f.?u.?c.?k/i",
        "/(s|$).?h.?i.?t/i",
        '/(potspace|mycrib|palbolt)/i');
    $text = preg_replace ($search, '', $text); 
    return $text;
}
</code></pre>

<p><hr></p>

<p><strong>UPDATE - Ok my new function after the suggestions from this post thanks guys</strong></p>

<pre><code>function FilterALLHTML($var) {
    //old array line //"'&lt;[\/\!]*?[^&lt;&gt;]*//?//&gt;'si",// strip html
    if ($var != null){
     $text = strip_tags($var);
     $search = array ("/f.?u.?c.?k/i",
         "/(s|$).?h.?i.?t/i",
         '/(potspace|mycrib|palbolt|pot space)/i');
     $text = preg_replace ($search, '', $text); 
     return $text;
    }
    return null;
}
</code></pre>
