3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'one|two|three|four'; // positive limit print_r(explode('|', $str, 2)); // negative limit (since PHP 5.1) print_r(explode('|', $str, -1));
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Array ( [0] => one [1] => two|three|four ) Array ( [0] => one [1] => two [2] => three )
Output for 4.3.0 - 5.0.5
Array ( [0] => one [1] => two|three|four ) Array ( [0] => one [1] => two [2] => three [3] => four )