What are the potential pitfalls of using the split function in PHP to split file names?

Using the split function in PHP to split file names can be problematic because it is deprecated as of PHP 7.0 and removed in PHP 7.3. It is recommended to use the explode function instead, which is more efficient and does not have the same security vulnerabilities as split.

$file_name = "example.txt";
$parts = explode(".", $file_name);
$filename = $parts[0];
$file_extension = $parts[1];
echo "Filename: " . $filename . "<br>";
echo "File Extension: " . $file_extension;