What are the potential pitfalls of using print_r for array outputs in PHP?
Using print_r for array outputs in PHP can be problematic because it can be difficult to read and understand the output, especially for large or nested arrays. It also exposes sensitive information about the array structure, which may not be desirable in a production environment. To solve this issue, it's recommended to use the var_dump function instead, which provides a more detailed and structured output of the array.
// Using var_dump instead of print_r for array outputs
$array = array('a', 'b', 'c');
var_dump($array);