3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function dePercent($value) { $number = preg_replace("/[^0-9.]/", "", $value); if (strpos($value,'%') !== FALSE) { return intval($number)*.01; } return $number; } dePercent("%5");
Output for 4.3.0 - 7.1.0