Page 2 of 2

Re: If and else statements on upload form!

Posted: Sat Dec 10, 2011 11:25 pm
by lisa evans
Thank you very much and can you give me an example of the nested loop that will be required to display the messages of $result?

Re: If and else statements on upload form!

Posted: Sun Dec 11, 2011 6:19 am
by McInfo

Code: Select all

<?php
header('Content-Type: text/plain');

$array = array (
    'A' => array (
        'a',
        'b',
        'c'
    ),
    'B' => array (
        'd',
        'e',
        'f'
    ),
);
$array['C'][] = 'g';
foreach ($array as $key => $child) {
    echo "+ $key\n";
    foreach ($child as $value) {
        echo "  - $value\n";
    }
}
/*
+ A
  - a
  - b
  - c
+ B
  - d
  - e
  - f
+ C
  - g
*/

Re: If and else statements on upload form!

Posted: Sun Dec 11, 2011 8:55 pm
by lisa evans
Many thanks!