title: PHP, parsing out a string from within square brackets
body: <p>In PHP, I would like to extract the string <code>Nickname</code> from this string: <code>to[Nickname]</code>.</p>
  
  <p>I have tried using <code>preg_split()</code> but without success.</p>
  
  <p><strong>Update</strong></p>
  
  <blockquote>
    <p>how would i make it to extract from "to[nickname]" though? the "to"
    before the brackets is also kinda important because it identifies what
    kind of message the user is sending</p>
  </blockquote>