Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
$str = 'one,two,three,four';
// zero limit
print_r(explode(',',$str,0));
print "<br>";
// positive limit
print_r(explode(',',$str,2));
print "<br>";
// negative limit 
print_r(explode(',',$str,-1));
?>  
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_explode2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:58 GMT -->
</html>
Array ( [0] => one,two,three,four )
Array ( [0] => one [1] => two,three,four )
Array ( [0] => one [1] => two [2] => three )