title: How to avoid Undefined offset error?
body: <p>This is a part of my script:</p>
  
  <pre><code>$one = 0;
  $two = 0;
  $three = 0;
  
  $data = 'a-b-c';
  
  $data = explode("-", $data);
  $one = $data[0];
  $two = $data[1];
  $three = $data[2];
  </code></pre>
  
  <p>No problems so far but <strong>$data</strong> sometimes can be</p>
  
  <pre><code>$data = 'a-b-c';
  </code></pre>
  
  <p>and sometimes</p>
  
  <pre><code>$data = 'a-b';
  </code></pre>
  
  <p>In case of <code>$data = 'a-b'</code>; I get <strong>Undefined offset: 3</strong> error. Is it some way how to avoid this error?</p>