First of all, I’m a complete newb. I’ve been trying to learn php for a total of one week so keep that in mind. I am working on this code and can’t seem to be able to print all of the users information. Can someone give me a suggestion of what I’m doing wrong?
[php]<?php
$userData = array();
$userData[] = array(
‘Name’ => ‘Joe Banks’,
‘Acct’ => ‘12345’,
‘Email’ => ‘[email protected]’,
‘UserName’ => ‘Joe’,
‘Active’ => false);
$userData[] = array(
‘Name’ => ‘Polly Cartwrite’,
‘Acct’ => ‘34567’,
‘Email’ => ‘[email protected]’,
‘UserName’ => ‘PCart’,
‘Active’ => true);
$userData[] = array(
‘Name’ => ‘Jake Jarvis’,
‘Acct’ => ‘81812’,
‘Email’ => ‘[email protected]’,
‘UserName’ => ‘jakej’,
‘Active’ => true);
$userData[] = array(
‘Name’ => ‘Kelly Williams’,
‘Acct’ => ‘76253’,
‘Email’ => ‘[email protected]’,
‘UserName’ => ‘kellyw’,
‘Active’ => false);
$userData[] = array(
‘Name’ => ‘Cindy Ella’,
‘Acct’ => ‘62341’,
‘Email’ => ‘[email protected]’,
‘UserName’ => ‘Cinders’,
‘Active’ => true);
function printUserTable($userData){
foreach($userData as $singleUser){
echo $singleUser;
}
}
printUserTable($userData);
?>[/php]