Jump to content

print_r() array from function :: cannot get an print_r() to output


OldWest

Recommended Posts

I've got a few hours in this, read the manual on return (and it appears my print_r should be working!).. And I am unable to get print_r() to output the contents of my function array.

 

What am I doing wrong?

 

function getStateName()
{
$stateName = array("Alabama","Florida","Nevada");
return $stateName;
}

echo "<pre>";
echo print_r($stateName);
echo "</pre>";

Vitamin,

 

Thanks for confirming that :) .. I tried that earlier, and it was not working BUT I just found the problem was in my form.. I forgot to set the method to post, and  I could not get anything to print to the screen with my submit button! I think its time for bed.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.