What are the advantages of using custom functions like extr() over built-in PHP functions like explode() for data manipulation?

When working with data manipulation in PHP, using custom functions like extr() can offer several advantages over built-in functions like explode(). Custom functions can be tailored specifically to the requirements of the project, offering more flexibility and control over the data processing. Additionally, custom functions can improve code readability and maintainability by encapsulating complex logic into a single function.

// Custom function extr() for data manipulation
function extr($data, $delimiter) {
    // Custom logic to extract data based on delimiter
    // Return processed data
}

// Implementation of custom function extr()
$data = "apple,orange,banana";
$delimiter = ",";
$result = extr($data, $delimiter);
echo $result;