well, I only have an answer to the second question. array_push has the same effect as doing the following:
$temp = Array("1", "2", "3"); // Define array
$temp[] = "3";
This will put 3 at the end of the array. Same idea. If you used the return value of array_push (which was equal to the new size of the array) then you could easily do a sizeof($array) to get the size of the new array.
For the second question, I believe (I'm a little rusty, so don't take my word for it) that you can find out with a quick ereg
if (ereg("([0-9.]*)$", $variable)) {
// Only contains numbers and dots
}
Now, this would also allow 123.123.123 to go through, but its better than nothing.
I just made this one up, haven't tested it, but you could possibly do:
if (ereg("[0-9]{1,50}.?[0-9]{0,50}$", $variable)) {
// Is numeric
}
Hope that helps!
Chris King