menu_additem in for loop
Hi,
I'm kinda stuck at a for loop. PHP Code:
PHP Code:
Problem number 2: i currently have this as my code and i know it could be done way much better, could someone help me out doing this with a loop? PHP Code:
|
Re: menu_additem in for loop
Just use num_to_str and convert "i" to a string. Anyway, do you really need this param? You could ignore it.
|
Re: menu_additem in for loop
Yea, but he starts "i" with 0 because he must match array cells because they start from 0.
then he will use num_to_str(i+1) |
Re: menu_additem in for loop
or you can use i + 1 + '0' too.
|
Re: menu_additem in for loop
I'll just ignore the param, didn't know i could, thanks, what about problem number 2? This could be done in a loop aswell but i just can't seem to figure out how..
PHP Code:
PHP Code:
PHP Code:
|
Re: menu_additem in for loop
No, case is called once, ohh. I better show you how simple it is :
don't use switch... just use directly: PHP Code:
|
Re: menu_additem in for loop
lol, didn't even think about that but it works perfectly, thanks man. Didn't know that stock would come out that handy.
|
| All times are GMT -4. The time now is 18:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.