title: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH'
body: <p>I use Codeigniter as the framework and create an array like below using input parameters from a form.</p>
  
  <pre><code>$data           = array(
      'generated_id'      =&gt; $this-&gt;input-&gt;post('generated_id'),
      'one'               =&gt; $this-&gt;input-&gt;post('one'),
      'two'               =&gt; $this-&gt;input-&gt;post('two'),
      'three'             =&gt; $this-&gt;input-&gt;post('three'),
      'modified_date'     =&gt; date('Y-m-d H:i:s'),
      'modified_user_id'  =&gt; $this-&gt;session-&gt;userdata('user_id')
  );
  </code></pre>
  
  <p>What I want to do is if the value from the input fields are empty I want to set the value of the particular array position to NULL.
  I'm using below function to get it done.</p>
  
  <pre><code>$data = array_filter($data,function($value, $key){
      if(empty($value))
          return NULL;
      else
          return $value;
  }, ARRAY_FILTER_USE_BOTH);
  </code></pre>
  
  <p>But I end up with below error.</p>
  
  <pre><code>Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH'
  </code></pre>
  
  <p>Is there an easy way to get this done or how can I fix this?</p>