FANDOM


A function that splits a string into an array

Arguments Edit

void explode ({{{params}}})

Argument Inclusion Edit

  • Seperator - the character used to split the array

Examples Edit

Example 1: (example description) Edit

 <?php
 $array = explode('|', 'hello|hi|yo');
 print_r($array);
 $limitarray = explode('|', 'hello|hi|yo', 1);
 print_r($limitarray);
 ?>

Output Edit

Array(
  [0] => hello
  [1] => hi
  [2] =>yo
)
Array(
  [0] => hello
  [1] => hi|yo
)
For more details on this function, visit its entry in the php manual.