title: PHP explode and array index
body: <p>How can I get the following code to work?</p>
  
  <blockquote>
    <p>$a = explode('s', $str)[0];</p>
  </blockquote>
  
  <p>I only see solutions looking like this:</p>
  
  <blockquote>
    <p>$a = explode('s', $str); $a=$a[0];</p>
  </blockquote>