title: regular expression to get sub string via php
body: <p>How can I use a regular expression in the <code>substr()</code> PHP function to get a substring matched by a pattern?</p>
  
  <p>Edited:</p>
  
  <p>example:</p>
  
  <pre><code>$name = 'hello [*kitty*],how good is today';
  </code></pre>
  
  <p>I want to get what is between [<em>....</em>] placeholder.</p>