Home / PHP Tips Generated By ChatGPT / Splitting a String into an Array in PHP Split a string by a delimiter into an array using explode(). Source Code $string = "one,two,three"; $array = explode(",", $string); print_r($array); // Outputs the split elements as an array