By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

is_array() is failing on what is clearly an array

P: n/a
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)) {

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
lk******@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

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.