title: Add to an array only if a variable is set
body: <p>I have this array I'm doing like so:</p>
  
  <p>Turns out some of those var aren't always set which cause undefined index issues when trying to inserting it into the db?</p>
  
  <p>Is there a quick way to check each value is set before adding it to the array?</p>
  
  <pre><code>    $show_insert = array(
          'title' =&gt; $show_data['title'],
          'thetvdb_id' =&gt; $show_data['tvdbid'],
          'release_date' =&gt; $show_data['FirstAired'],
          'lastupdatethetvdb' =&gt; $show_data['lastupdatethetvdb'],
          'moviedb_id' =&gt; $show_data['moviedb_id'],
          'imdb_id' =&gt; $show_data['IMDB_ID'],
          'img_id' =&gt; $show_data['tvdbid'],
          'media_type' =&gt; 1,
          'status' =&gt; $show_data['status'],
          'length' =&gt; $show_data['runtime'],
          'network' =&gt; $show_data['network'],
          'overview' =&gt; $show_data['overview'],
          'seasons' =&gt; $show_data['seasons'],
          'episodes' =&gt; $show_data['episodes'],
          'homepage' =&gt; $show_data['homepage'],
          'last_airdate' =&gt; $show_data['last_air_date'],
          'vote_average' =&gt; $show_data['vote_average']
      );
  </code></pre>