What is causing the "Notice: Undefined offset" errors in the PHP script?
The "Notice: Undefined offset" errors in a PHP script occur when trying to access an array element that does not exist. This can happen if the index being accessed is not set or if the array is empty. To solve this issue, you can check if the index exists before trying to access it using isset() or array_key_exists().
// Check if the index exists before accessing it
if(isset($array[$index])) {
// Access the array element
$value = $array[$index];
} else {
// Handle the case when the index does not exist
$value = null;
}