Thanks weedpacket
the problem was that the array was not aviliable for the switch. I could not hide that error. I implimented the right method to call it to the script so that I can use the switch based on values in the array.
Still I do not understand why it works on my localhost. I have not edited the php.ini yet. Could globals be turned on. While on the hosting site globals is turned off.
incrementing an array such as array[$x++] without known values will cause an offset error.
Why do you think it worked on my server?
Thanks