3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'one|two|three|four'; // positive limit print_r(explode('|', $str, 3)); // negative limit (since PHP 5.1) print_r(explode('|', $str, -2));

preferences:
74.07 ms | 402 KiB | 5 Q