title: php - How To Convert 1 day To Seconds
body: <p>I am creating a form to set publish interval and want to sum all of the submitted values into seconds. The form consist of fields to determine seconds, minutes, hours, day and so on.</p>
  
  <p>I am collecting the submitted values to string by giving date attributes, like second, minute etc.</p>
  
  <p><strong>For example:</strong></p>
  
  <p>$second second</p>
  
  <p>$minute minute</p>
  
  <p>$hour hour</p>
  
  <p>So if user input 1 in input field to determine the interval in <code>day</code> and 30 in <code>minute</code>, then my code will convert it to string <code>1 day</code> and <code>30 minute</code>.</p>
  
  <p><strong>My questions:</strong></p>
  
  <p>1- How can I convert <code>1 day</code> and <code>30 minute</code> string into seconds so they can be summed up into correct seconds.</p>
  
  <p>I tried to use <code>strtotime()</code> but it returns a very large number of seconds and <code>date()</code> but it return too small number.</p>
  
  <p>2- Is there a simple function like <code>strtotime()</code> and <code>date()</code> that can do string to second conversion correctly?</p>