Thread: Array confusion
View Single Post
Old 09-22-2007, 10:52 PM   #1 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default Array confusion

Yes, I confused myself with Arrays.

PHP Code:
Array
(
    [
0] => Array
        (
            [
field] => szUsername
            
[value] => 
            [
error] => Please enter a username
        
)

    [
1] => Array
        (
            [
field] => szPassword
            
[value] => 
            [
error] => Please enter a password
        
)


How do I out the error only?

Current code:

PHP Code:
    if($this->aErrors){
        echo 
'<div id="error">';
        echo 
'<ul>';
        foreach(
$this->aErrors as $iKey => $szValue){
                echo 
'<li>'.$szErrors['error'].'</li>';
        }
        echo 
'</ul>';
        echo 
'</div>';
    }
    
    echo 
'<pre>'.print_r($this->aErrors1); 
Haris is offline  
Reply With Quote