Skip to content
Advertisement

explode() offset and delimiter warnings when delimiter is valid

I’m having a heck of a time trying to figure out what is going on. I have a block of code that is throwing some errors. Outside of the Warnings and Notices the code works fine and the arrays are not empty. But why I am getting those warnings and notices is bothersome. In my test environment I don’t get the errors however when put on a different server they pop right up. I am stumped as to why. The lines of code that are throwing the errors and the errors being thrown are as follows

JavaScript

The entire block of code is as follows with the problem lines denoted with a @ in them

JavaScript

Advertisement

Answer

First of all dont use @ because it will bypass the error message. So user error_reporting(E_ALL) till development phase.

Then you are getting undefined offset it means your array is empty of does not exist so put a condition to check if it exist then the explode should work. It must be like that :

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement