How can PHP efficiently access array values based on numerical indexes for dynamic data processing?

When processing dynamic data in PHP, accessing array values based on numerical indexes efficiently is crucial. One way to achieve this is by using a loop to iterate through the array and access each value using its numerical index. This allows for dynamic data processing without hardcoding specific keys.

$data = [10, 20, 30, 40, 50];

for ($i = 0; $i < count($data); $i++) {
    echo $data[$i] . "\n";
}