title: How do I convert a string to a number in PHP?
body: <p>I want to convert these types of values, <code>'3'</code>, <code>'2.34'</code>, <code>'0.234343'</code>, etc. to a number. In JavaScript we can use <code>Number()</code>, but is there any similar method available in PHP?</p>
  
  <pre><code>Input             Output
  '2'               2
  '2.34'            2.34
  '0.3454545'       0.3454545
  </code></pre>