Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question echo out an array?

    Just wondering why I can't echo out an array? hmm

    PHP Code:

    while($i=mysql_fetch_row($cur))
    {
    $show_chamber[$show_newbookingscount]=$i[0];
    $show_surgery[$show_newbookingscount]=$i[1];
    $show_branch[$show_newbookingscount]=$i[2];
    $show_sessiontype[$show_newbookingscount]=$i[3];
    $show_datebooking[$show_newbookingscount]=$i[4];
    $show_starttime[$show_newbookingscount]=substr($i[5],11,5);
    $show_finishtime[$show_newbookingscount]=substr($i[6],11,5);
    $show_increment[$show_newbookingscount]=$i[7];
    $show_duration[$show_newbookingscount]=$i[8];
    $show_cost[$show_newbookingscount]=$i[9];
    $show_surgeryname[$show_newbookingscount]=$i[10];
    $show_branchname[$show_newbookingscount]=$i[11];
    $show_bookingtempid[$show_newbookingscount]=$i[12];
    $show_newbookingscount++;
    }

    echo 
    'start time: '.$show_starttime[$show_newbookingscount].'<br />'

  • #2

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,313
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    You can't echo out an array - php will literally pass the value of 'array()' back to the server which is what you'll then see on the webpage.

    Instead you can use var_dump($Array) or print_r($Array).
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •