Constant in if statements?
Let's say I have a constant like this:
PHP Code:
PHP Code:
Or do I have to do PHP Code:
PHP Code:
|
Re: Constant in if statements?
loop if array size is big
|
Re: Constant in if statements?
Could use bit field, not sure what exactly youre doing but its just an idea. You are limited to using a min of 0 and max of 31 but you can extend it with a little more code. Let me know if you have any questions.
PHP Code:
|
Re: Constant in if statements?
Quote:
|
Re: Constant in if statements?
The above way is a good way to go about it. What range of numbers are you working with?
|
Re: Constant in if statements?
Well acually this was just an example, I was mostly curious if it was possible to do this...
So yeah basically any range of numbers. |
Re: Constant in if statements?
Then use a loop checking each value of the array.
PHP Code:
|
Re: Constant in if statements?
Hmm, wouldn't a string character search function work in this case too ? I dunno but I can't find it, I know there's one that searches for a single character inside a string... and you'll just use the constant array as the string and the character as your variable number (must be converted to char number tough, number 1 is char 38, something like that)
|
Re: Constant in if statements?
Quote:
|
Re: Constant in if statements?
Explain specifically what you are doing so we can provide an exact solution.
|
| All times are GMT -4. The time now is 03:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.