What potential pitfalls or errors can occur when using the print_r() function to display individual items in an array in PHP?

When using the print_r() function to display individual items in an array in PHP, one potential pitfall is that it will display the entire array structure, which may make it difficult to locate the specific item you are interested in. To solve this issue, you can use the key to access the specific item directly from the array.

// Sample array
$fruits = array("apple", "banana", "cherry");

// Displaying a specific item using key
echo $fruits[1]; // Output: banana