I read the guide on scripting and this made me think:
if (foo) ... // this will check if 'foo' has been declared or not. If the value 'foo' // holds is different from 0 (declared), it will return true. Otherwise it // will return false.
if (foo != 0) ... // Same as above
Does this mean that a varable with 0 is the same as null (variable not declared)?
I need to store the index of an array, that can be any number between (incl) 0 and 19.
I have checks not to execute the array indexing, if the index is not set [ if ($var != null) ]
Do I have to rewrite my index variable to store numbers between 1 and 20 and when indexing the array reduce it by one?
Question
Antares
Hi!
I read the guide on scripting and this made me think:
Does this mean that a varable with 0 is the same as null (variable not declared)?
I need to store the index of an array, that can be any number between (incl) 0 and 19.
I have checks not to execute the array indexing, if the index is not set [ if ($var != null) ]
Do I have to rewrite my index variable to store numbers between 1 and 20 and when indexing the array reduce it by one?
Edited by AntaresLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.