$string = "apple,banana,orange"; $array = CRM_Utils_System::explode(',', $string); print_r($array);
Array ( [0] => apple [1] => banana [2] => orange )
$string = "red|green|blue"; $array = CRM_Utils_System::explode('|', $string); echo $array[1];
greenIn this example, we are splitting the string "red|green|blue" into an array using the delimiter '|'. We then print the second element of the array, which is "green". The CRM_Utils_System function is part of the CiviCRM package library, which is a popular open-source CRM system for non-profit organizations. The function can be used in custom extensions and modules that are developed for CiviCRM.