Can you explain the use of ob_start, ob_get_contents, and ob_end_clean in capturing print_r output in PHP?

To capture the output of `print_r` in PHP, you can use output buffering functions like `ob_start`, `ob_get_contents`, and `ob_end_clean`. `ob_start` turns on output buffering, `ob_get_contents` retrieves the contents of the buffer, and `ob_end_clean` discards the buffer contents and turns off output buffering. By using these functions in sequence, you can capture the output of `print_r` and store it in a variable for further processing.

ob_start();
print_r($your_array);
$print_r_output = ob_get_contents();
ob_end_clean();

// Now $print_r_output contains the output of print_r($your_array)