PHP spliti() Function

PHP spliti() Function


Hello folks! welcome back to a new section of our tutorial on PHP. In this tutorial guide, we are going to be studying about the PHP spliti() Function.

The PHP spliti() function operates exactly in the same way as its sibling split(), except that it is not case sensitive. Case sensitive characters are only an issue only when the pattern is alphabetic. For other characters spliti() operates the same way as the split() function does.


Syntax

The following is the syntax for the spliti() function -

array spliti (string pattern, string string  [, int limit]);

Return Value

  • This PHP function returns an array of strings after splitting up a string.

Example

Following is a simple example -

<?php
   
   $ip = "123.456.789.000"; // some IP address
   $iparr = spliti ("\.", $ip, 3); 
   
   print "$iparr[0] <br />";
   print "$iparr[1] <br />" ;
   print "$iparr[2] <br />"  ;
   print "$iparr[3] <br />"  ;

?>

Output

The example will produce only three strings as we have limited number of strings that is to be produced -

123
456
789.000


Alright guys! This is where we are rounding up for this tutorial post. In our next tutorial guide, we are going to be discussing about the PHP sql_regcase() Function.

Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.