PHP explode Function

The PHP explode function split the string into sub-string(or array).

SYNTAX

explode(separator,string,limit)

RETURN VALUE

Returns an array of strings

Example for PHP explode function

<?php
$str = “A quick brown fox jumps over the lazy dog”;
print_r (explode(” “,$str));
?>

PARAMETER

 

NameDescriptionRequired /Optional
separatorThe boundary string. 
stringThe input string. 
limitIf limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string. If the limit parameter is negative, all components excep