PHP - Function spliti()
array spliti (string pattern, string string [, int limit])
Definition and Usage
The spliti() function operates exactly in the same manner as its sibling split(), except that it is not case sensitive. Case-sensitive characters are an issue only when the pattern is alphabetical. For all other characters, spliti() operates exactly as split() does.
- Returns an array of strings after splitting up a string.
Following is the piece of code, copy and paste this code into a file and verify the result.
<?php $ip = "123.456.789.000"; // some IP address $iparr = spliti ("\.", $ip, 3); print "$iparr <br />"; print "$iparr <br />" ; print "$iparr <br />" ; print "$iparr <br />" ; ?>
This will produce only three strings as we have limited number of strings to be produced.