What are common methods for splitting a sentence into two parts in PHP?

One common method for splitting a sentence into two parts in PHP is to use the `explode()` function, which splits a string into an array based on a specified delimiter. Another method is to use the `substr()` function to extract a portion of the string. Additionally, you can use regular expressions with the `preg_split()` function to split the sentence based on a pattern.

// Using explode() function
$sentence = "Hello, world!";
$parts = explode(",", $sentence);
echo $parts[0]; // Output: Hello
echo $parts[1]; // Output: world!

// Using substr() function
$sentence = "Hello, world!";
$part1 = substr($sentence, 0, strpos($sentence, ","));
$part2 = substr($sentence, strpos($sentence, ",") + 2);
echo $part1; // Output: Hello
echo $part2; // Output: world!

// Using preg_split() function
$sentence = "Hello, world!";
$parts = preg_split("/,/", $sentence);
echo $parts[0]; // Output: Hello
echo $parts[1]; // Output: world!