Where can the source code for the print_r() function be found?

The source code for the print_r() function in PHP can be found in the PHP source code repository. If you want to view the actual implementation of the print_r() function, you can visit the PHP GitHub repository or the official PHP website. However, it is important to note that modifying the source code of PHP functions is not recommended, as it can lead to unexpected behavior and compatibility issues.

// Since modifying the source code of PHP functions is not recommended, we can create a custom function that replicates the functionality of print_r().

function custom_print_r($data) {
    echo "<pre>";
    print_r($data);
    echo "</pre>";
}

// Example usage
$data = array('foo' => 'bar', 'hello' => 'world');
custom_print_r($data);