title: How can I get string between two characters [string] ? PHP
body: <pre><code>$string1 = "This is test [example]";
  $string2 = "This is test [example][2]";
  $string3 = "This [is] test [example][3]";
  </code></pre>
  
  <p>How can I get the following result?</p>
  
  <pre><code>For $string1 -&gt; example
  For $string2 -&gt; example*2
  For $string3 -&gt; is*example*3
  </code></pre>