I've a table with the following time format "1h1m1s" (or "1m1s"). So the question is how to convert it to seconds only format? For example 1m1s = 61 (seconds).
Tried to select from database and replace with an arithmetical operators in PHP, but it doesn't work.
$options = get_table($table_name, $order);
for($i = 0; $i < count($options); $i++){
$duration = $options[$i]['duration'];
$original = array("h", "m", "s");
$change = array('*3600+', '*60+', '*1');
$string = str_replace($original, $change, $duration);
echo $string;
}