3v4l.org

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