use the break function. this will solve your problem. blast structure is like this
array explode ( string $delimiter , string $string [, int $limit ] )
now $delimiter
is the boundary string, string $string
is the input string. for limitation:
If the limit is set and positive, the returned array will contain the maximum limit elements with the last element containing the rest of the string.
If the limit parameter is negative, all components except the last -limit are returned.
If the limit parameter is zero, then this is considered as 1.
follow the link below. you can learn best php.net link
source share