![]() |
|
#1
|
|||
|
|||
![]()
I realize this is a very old question but I peeked at your Raffle Mod and noticed it's still using the if statement so I'm sorry if you have already found your answer but in case you haven't (or someone in the future needs the answer) here it is -
You should just be able to do something like this: PHP Code:
PHP is a loosely typed language and while that is usually convenient it can sometimes cause variables to misbehave and do strange things. Strongly typed languages require you to define what type of variable you're making when you name it. (ex: string, float, int, etc). ![]() Data from $mysidia->input->post("stuff") behaves like a string but you can't check if $i is less than a string because a string could very well be something like "sheep" and it would be very difficult to count to sheep. Luckily, it is very easy to turn a string into a number type of variables. PHP Code:
As an aisde, when checking something like the options from a dropdown menu you may be better off using a switch statement instead of a long if-else if-else. I find they're a bit easier to read (as long as you remember to include the break;!) and I believe they're a little less resource intense though that doesn't matter very much here. Mysidia is written in PHP and PHP has a lot of interesting functions. Two great resources for looking things you need up (besides Google, Google will likely direct you to one of the two if you ask PHP questions and it's a great way to get where you're going faster) are the PHP Manual and W3Schools. I strongly prefer the PHP Manual (the comments are especially helpful) but I have friends who understand the W3School explanations better. |
![]() |
|
|
What's New? |
What's Hot? |
What's Popular? |