This is a discussion on is_array() is failing on what is clearly an array within the PHP Language forums, part of the PHP Programming Forums category; This driving me crazy. I get an array. I use print_r() to prove to myself it is an array. An ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This driving me crazy. I get an array. I use print_r() to prove to
myself it is an array. An array prints to the screen. The next line is an is_array() test, and the code tests false and I get the error message, "we could not find the array". What the hell? $arrayOfFinalResultsForCommands = $this->controllerForAll->includeFile("arrayOfFinalResultsForCommands", "arrayOfFinalResultsForCommands", $command); echo "<p>here is the array: "; print_r($arrayOfFinalResultsForCommands); if (is_array($arrayOfFinalResultsForCommands)) { |
|
|||
|
lkrubner@geocities.com wrote:
> This driving me crazy. I get an array. I use print_r() to prove to > myself it is an array. An array prints to the screen. The next line is > an is_array() test, and the code tests false and I get the error > message, "we could not find the array". What the hell? > print_r(array()); output: Array ( ) print_r(new stdClass); output: stdClass Object ( ) If you see something simular to the latter, test with is_object(). JW |