• PHP Video Tutorials

PHP - Function explode



Syntax

array explode ( string $delimiter , string $string [, int $limit ] )

Definition and Usage

It is used to split a string by string

Return Values

It returns the array of string

Parameters

Sr.No Parameters & Description
1

delimiter

The boundary string

Example

Try out the following example

<?php
   $str = "tutorialspoint simply easy learning.";
   
   print_r (explode(" ",$str));
?>

This will produce following result −

Array ( [0] => tutorialspoint [1] => simply [2] => easy [3] => learning. )
php_function_reference.htm
Advertisements