title: Preg_Match_All: two values in a pattern
body: <p>I have custom tags <code>[tag val=100][/tag]</code>. How do I get <code>val</code> and whatever goes between the tags?</p>
  
  <p>ex:</p>
  
  <pre><code>[tag val=100]apple[/tag]  
  </code></pre>
  
  <p>value1 = 100<br>
  value2 = apple</p>
  
  <p>edit: what if I had multiple items inside the tag<br>
  ex:  </p>
  
  <pre><code>[tag val=100 id=3]
  </code></pre>