split() function divides a string into various elements. : split « String « PHP






split() function divides a string into various elements.

 
Its syntax is: array split (string pattern, string string [, int limit])

<?
$ip = "123.456.789.000";      
$iparr = split ("\.", $ip);   
                              
print "$iparr[0] <br>";       
print "$iparr[1] <br>";       
print "$iparr[2] <br>";       
print "$iparr[3] <br>";       
?>
  
  








Related examples in the same category

1.Generating date-based drop-down menu options
2.split.php
3.Use split() to limit a parameter to restrict division of $ip