What is the potential issue with PHP memory limit when trying to store data in an array?

When trying to store a large amount of data in an array in PHP, you may encounter memory limit issues if the amount of data exceeds the PHP memory limit set in the php.ini file. To solve this issue, you can increase the memory limit in the php.ini file or dynamically adjust the memory limit within your PHP script using the `ini_set` function before storing the data in the array.

// Increase memory limit
ini_set('memory_limit', '256M');

// Store data in an array
$data = [];
for ($i = 0; $i < 1000000; $i++) {
    $data[] = $i;
}