I have an array which looks something like this:
array(-2, -1, 0, 1, 2, 3, 4)
I would like to count the number of negative numbers only. I can’t spot where it says how to do this in the manual, is there no function to do this? Do I have to create a loop to go through the array manually?
Yes, you have to do it manually by easily doing:
At the end of the script
$iwill contain the number of negative numbers.