![]() Topic awaiting preservation: PHP,Arrays (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: |
![]() Why is it. |
Maniac (V) Inmate From: under the bed |
![]() answer 1 - because you declare it as $animals = array |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Cool!! |
Paranoid (IV) Inmate From: Milwaukee |
![]() Bear in mind that if you typed |
Maniac (V) Inmate From: under the bed |
![]() |
Paranoid (IV) Inmate From: Milwaukee |
![]() Really? Weird. Just goes to show that if you've got an array that might be empty, check for content before outputting it. Thanks for the tip. |
Maniac (V) Inmate From: under the bed |
![]() |
Paranoid (IV) Inmate From: Milwaukee |
![]() Well, I can't imagine a situation where I'd want to try echoing an array directly... I always loop through the elements with a for, while, or foreach. And yeah, if I suspect the array might be empty, I check with something like "if (count($variable) > 0)". |
Maniac (V) Inmate From: under the bed |
![]() |
Paranoid (IV) Inmate From: |
![]() ahh ok.. well the deal is im writeing a |
Maniac (V) Inmate From: under the bed |
![]() Trigger - my 1st reply gives you the function to do just that - print_r() |