How do I convert this string to float number?


How do I convert this string to float number?

<?php
$s="1/2";
echo (0+($s)); //echos 1
echo floatval($s); //echos 1
?>

How do I convert it to 0.5 in PHP?
Thanks