is_array() is failing on what is clearly an array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lkrubner@geocities.com

    is_array() is failing on what is clearly an array

    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?




    $arrayOfFinalRe sultsForCommand s =
    $this->controllerForA ll->includeFile("a rrayOfFinalResu ltsForCommands" ,
    "arrayOfFinalRe sultsForCommand s", $command);
    echo "<p>here is the array: ";
    print_r($arrayO fFinalResultsFo rCommands);

    if (is_array($arra yOfFinalResults ForCommands)) {

  • Janwillem Borleffs

    #2
    Re: is_array() is failing on what is clearly an array

    lkrubner@geocit ies.com wrote:[color=blue]
    > 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?
    >[/color]

    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



    Comment

    Working...