Splitting a string into an array - PHP Views : 222
Tagged in : PHP
0 0
Send mail
Splitting a string into an array

The function 'explode' is used to split a string into an array using a separator. It takes the separator and the string as its argument.

Syntax

explode(separator,stringname);


Example

$string="13-09-2010"

explode("-",$string);

Output : 13 in array[0] , 09 in array[1] , 2010 in array[2]
By Sanju, On - 2010-09-17



    Login to add Comments .