PHP explode() function is used to break a string into an array.

BY Best Interview Question ON 25 Oct 2019

Example

$string = "My Name Is BestInterviewQuestion";
print_r (explode(" ",$string));

// OUTPUT : Array ( [0] => My [1] => Name [2] => Is [3] => BestInterviewQuestion )