How can explode be used in PHP to extract specific parts of a string?

To extract specific parts of a string in PHP, you can use the explode function. Explode takes a delimiter and a string as input and splits the string into an array based on the delimiter. You can then access specific parts of the array to extract the desired information from the original string.

$string = "Hello,World,How,Are,You";
$parts = explode(",", $string);

// Extracting specific parts from the array
$part1 = $parts[0]; // Hello
$part2 = $parts[1]; // World
$part3 = $parts[2]; // How
$part4 = $parts[3]; // Are
$part5 = $parts[4]; // You