I'm at my wits end with this.
Not only can i not figure out what's going on with PHP, i feel like i'm being ignored by almost everyone that codes in php.
Anyway, i'll explain the problem further.
There's a line in a text file, which i've turned into the variable $text by using tail -n1 filmquiz.txt.
This returns 100#Message_1|Message_2||Message_3|Message_4
Now, i explode this initially by doing $pores = explode('#',$text), and setting $pores[0] to be $maxpoints (since it's an integer i use settype to change it first).
I print this in the default case statement, and it comes out 100. Good. Great.
Now, when i go onto the next case statement, it suddenly changes to 0, or worse, it disappears, and i get a nasty divide by zero error.
I have tried setting $maxpoints as a global, i have tried setting $maxpoints inside the case statement.
Nothing works. Somehow, it's just not seeing that variable, and it doesn't want to.
Please, for the love of god, someone help me.
Replying with messages like "i had a problem like that once, how did i get around it?" is NOT helpful.
C'mon! I just want a little help!
Thanks