title: how to get price for hour PHP
body: <p>I have to do an exercise in which if a car has been parked for 1 hour or less it must pay $ 50 and if an hour passes it should be $ 100 (the double) and so on.</p>
  
  <pre><code>function a(){
  $time = 10; // x time
  
  $hour = 50;
  echo "price for hour: " . $hour;
  
  if ($time &lt; 60) {
  
      $time_parked = $hour;
      return $time_parked;
  
  } elseif ($time &gt; 60 &amp;&amp; $time &lt; 120) {
  
      $time_parked = $hour * 2;
      return $time_parked;
  
  }
  
  echo "Amount to pay: " . $time_parked;  
  </code></pre>
  
  <p>the time is received in minutes</p>