Question: what is undefined offset 1 in php?
Answer: An offset is undefined if it doesn't exist in the array. The notice is thrown the first time you reference the element, then PHP initializes the element and sets it to NULL. ... You can test if an offset exists either through array_key_exists or using isset.