How to remove the empty entity from an array
<p>I have a function, which returns back the array. But the way I form this array is by "explode"ing a string. And when I do that, I get an extra empty string. </p>

<p>So now my issue is that I dont want to return the empty array entity. </p>

<p>My function code is shown below: </p>

<pre><code>public function purge_file($keys)
{
    if(empty($keys))
        throw new C7_Exception('Missing/Bad arguments');                
    $lib_tools_storage = new C7_Lib_Tools_Storage();
    $file_ids = explode(";",$keys);
    foreach($file_ids as $key)
    {       
        //echo "this is file_id = $key  ";
        if(!empty($key))
            $lib_tools_storage-&gt;purge_file($key);       
    }

    return array('result_code' =&gt; 0,
                    'data' =&gt; array('keys' =&gt; $file_ids)
                    );
}
</code></pre>
