title: How Do I Take Out Only Numbers From A PHP String?
body: <p>Suppose, I have this string:</p>
  
  <pre><code>$string = "Hello! 123 How Are You? 456";
  </code></pre>
  
  <p>I want to set variable <code>$int</code> to <code>$int = 123456;</code></p>
  
  <p>How do I do it?</p>
  
  <p>Example 2:</p>
  
  <pre><code>$string = "12,456";
  </code></pre>
  
  <p>Required:</p>
  
  <pre><code>$num = 12456;
  </code></pre>
  
  <p>Thank you!</p>