Tsallaka zuwa abun ciki
Justice Tech School

implode, explode and str_split

explode splits text into an array and implode joins an array into text.

Example
print_r(explode(",", "a,b,c"));
echo implode("-", [1, 2, 3]), "\n";
print_r(str_split("abc"));

Result

Array
(
    [0] => a
    [1] => b
    [2] => c
)
1-2-3
Array
(
    [0] => a
    [1] => b
    [2] => c
)

Exercise

Join array to text.

("-", $a)

Quiz Test

What does explode return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.