3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'cream 100g'; $p = strcspn($str, '0123456789'); $before = substr($str, 0, $p); $after = substr($str, $p); echo "before: $before, after: $after";
Output for 4.3.2 - 7.1.0
before: cream , after: 100g
Output for 4.3.0 - 4.3.1
before: , after: cream 100g