What is the significance of using print_r function in debugging PHP code?

Using the print_r function in debugging PHP code is significant because it allows developers to see the structure and contents of variables and arrays at runtime. This can help identify issues with variable values or array elements, making it easier to pinpoint and troubleshoot errors in the code.

// Example of using print_r function for debugging
$myArray = array('apple', 'banana', 'cherry');
print_r($myArray);