gal-s
11/27/2018 - 10:44 AM

evaluate string expression to its value

<?php
$s ="2+10";
$v = eval('return '.$s.';');
print $v;
//will return 12
?>