<?php $yearwithdecimal = "1.2"; $months = 0; if($yearwithdecimal){ $parts = explode('.', $yearwithdecimal); $months = $parts[0]*12 + $parts[1] ?? 0; } echo $months;
You have javascript disabled. You will not be able to edit any code.