title: how can i store preg match , match into a variable
body: <p>okay so i wanted to know how can i store preg_match, match into a variable only if the string itself has the matching preg_match.</p>
  
  <p>for example :</p>
  
  <pre><code>$string1 = "this is some example id=34 ";
  preg_match('/^id=(\d+)/', $string1); 
  </code></pre>
  
  <p>i want to store id=34 or id=somenumber into a variable only if $string1 contains id=somenumber
  so far i've been playing around with this but so far ive been getting either a true or false/ boolean answer and thats not what i want in this case</p>