explode

explode -- Split a string by string

Description

array explode(string separator, string string);

Returns an array of strings containing the elements separated by separator.

Example 1. Explode() example

  1 
  2 $pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
  3 $pieces = explode (" ", $pizza);
  4       

See also split() and implode().