title: PHP random decimal between two decimals with step 0.5
body: <p>I want to create random number between two decimal numbers with step 0.5.</p>
  
  <p>Examples: 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, ...</p>
  
  <p>Use PHP To Generate Random Decimal Beteween Two Decimals</p>
  
  <p>So far I can generate numbers between 0 and 5 with one decimal comma. </p>
  
  <p>How to integrate step 0.5?</p>
  
  <pre><code>$min = 0;
  $max = 5;
  $number = mt_rand ($min * 10, $max * 10) / 10;
  </code></pre>