The explode() function in PHP is used to split a string into multiple strings based on the specified delimiter. It is similar to the split function in Perl.
The syntax of the explode function is:
explode('delimiter', 'string', [limit])
The delimiter is the string (can be one or more characters) used to split string. [limit] is an optional parameter and has the following values:
- > 0: Returns an array with a maximum of limit elements.
- < 0: Returns an array except for the last-limit elements.
- 0: Returns an array with 1 element.
print_r (explode (',','one,two,three'));
Array (  => one  => two  => three )
$var = 'Learn PHP';
print_r (explode (' ',$var));
Array (  => Learn  => PHP )
print_r (explode (',','one,two,three',2));
Array (  => one  => two,three )