3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(!function_exists('decodeUnits')) { function decodeUnits($unit_str) { if(strlen($unit_str) == 1) { $unit_str = '0'.$unit_str; } if(strlen($unit_str) > 2) { return null; } if($unit_str == '00') { return 'KWh'; } if($unit_str == '07') { return 'Litres'; } if($unit_str == '03') { return 'm3'; } return null; } } echo decodeUnits("03"); ?>
based on tOreH
Output for 4.3.0 - 7.1.0
m3