<?php $tests = ['1.2', '1.0', '2.11']; foreach ($tests as $test) { sscanf($test, '%d.%d', $years, $months); $months += $years * 12; echo $months . PHP_EOL; }
You have javascript disabled. You will not be able to edit any code.