|
I guess I'm not sure what you are trying to do, then. I haven't tested it, but the code I provided should be able to take a variable, determine whether or not it is an array. If it is an array, it will take each instance and sanitize it and upload it to the database. If it is not an array, it will sanitize it and upload it to the database.
From what you wrote, that is what I thought you were trying to do. However, you can't explode an array. explode() is to turn a string into an array. implode() is to turn an array into a string.
If you are trying to remove the [0], [1], [2], etc., why are you including them to begin with? You can write an array as array('value', 'another value', 'still another value') and the numbered keys are implied. It's only when you need to name the keys as something other than ordered numbers that you need to write them out.
|