If and else statements on upload form!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

lisa evans
Forum Newbie
Posts: 9
Joined: Fri Dec 09, 2011 6:42 pm

Re: If and else statements on upload form!

Post 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?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: If and else statements on upload form!

Post 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
*/
lisa evans
Forum Newbie
Posts: 9
Joined: Fri Dec 09, 2011 6:42 pm

Re: If and else statements on upload form!

Post by lisa evans »

Many thanks!
Post Reply