How to correctly check the value of boolean in D7? I have a boolean single check-box field. and inside my node--content-type.tpl.php Idothe following check:

  &lt;?php if($content['field_hide_1st_line_of_the_addre']['und'][0]['value'] == 0): { ?&gt;
    &lt;?php print render($content['field_images']['#object']-&gt;field_location['und'][0]['street']) . t(', '); ?&gt;
    &lt;?php } else: { ?&gt;
    &lt;?php print t(''); ?&gt;
    &lt;?php } endif; ?&gt;


And it returns loads of "Notice: Undefined index: und in include() (line 80 of node--content-type.tpl.php"

Any idea what is going on?

UPDATE

  &lt;?php if (isset($content['field_hide_1st_line_of_the_addre']['und'][0]['value'])): { ?&gt;
    &lt;?php print render($content['field_images']['#object']-&gt;field_location['und'][0]['street']) . t(', '); ?&gt;
    &lt;?php } else: { ?&gt;
    &lt;?php print t(''); ?&gt;
    &lt;?php } endif; ?&gt;


is not the doing the check correctly: the Street field disappears forallteasers,while it should only disappear for those that have the boolean check-box ticked. 

UPDATE 2
This code didn't work either. Pave me a Parse error: syntax error, unexpected $end

&lt;?php 
  if (isset($content['field_hide_1st_line_of_the_addre'][LANGUAGE_NONE][0]['value'])) :
  if($content['field_hide_1st_line_of_the_addre']['und'][0]['value'] == 0): { ;
    print render($content['field_images']['#object']-&gt;field_location['und'][0]['street']) . t(', ');
  }  endif; 
?&gt;


UPDATE 3

I deleted that old field and created a new identical one.  Tried many things,but it turns out that for some unknown reason it just didn't like the 0 and preferred 1 instead.So I used 1,and just changed the wording of the field from "Hide full address" to "Display full address".  This is the code that worked for me.  If you seeany syntax mistakes,pleaselet me know.     

&lt;?php 
    if (isset($content['field_hide_address']['#items'][0]['value'])) :
    if($content['field_hide_address']['#items']['0']['value'] == '1'):
    print render($content['field_images']['#object']-&gt;field_location['und'][0]['street']) . t(', '); 
    endif;
     endif; ?&gt;
The error you're getting simply means that 

$content['field_hide_1st_line_of_the_addre']['und']


hasn't been set. It might be that the 'und' key is missing, or it might be that $content['field_hide_1st_line_of_the_addre'] simply hasn't been set at all. This can happen if you've added a new field to a content type that already has existing nodes (and probably in other situations too).

To remove the notice, you can just wrap your code in another condition that ensures the array element you're accessing exists. For example:

&lt;?php 
  if (isset($content['field_hide_1st_line_of_the_addre'][LANGUAGE_NONE][0]['value'])) :
    if ($content['field_hide_1st_line_of_the_addre'][LANGUAGE_NONE][0]['value'] == 0) : 
      print render($content['field_images']['#object']-&gt;field_location['und'][0]['street']) . t(', '); 
    endif;
  endif; 
?&gt;


I've taken the liberty of replacing 'und' with the constant equivalent (and cleared up a couple of other very minor issues), it's better practice. Even better practice would be to extract this logic out of the template file completely, and instead implement it in a preprocess function.