Good morning. I am uploading csv with php, it does the rendering but it gives the following error: "Undefined offset:" I can not identify this error and try ... Help me! ..
Good morning. I am uploading csv with php, it does the rendering but it gives the following error: "Undefined offset:" I can not identify this error and try ... Help me! ..
The " Undefined offset " error usually happens when you are trying to do some operation with the nonexistent value of an array.
In CSV files (or excel) sometimes comes empty rows and columns, which he understands as being part of a file (even though it has no value). So before you perform explodes , or other operations, it is always good to test if the value of the array actually exists:
if (isset($_FILES['file']['name']) && !empty($_FILES['file']['name'])) { [...] }