mehrdimesionale Arrays auslesen, eins wird 2x angezeigt

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • mehrdimesionale Arrays auslesen, eins wird 2x angezeigt

    Hallo,

    ich möchte mit meinem code 2 Arrays auslesen.

    Code:
     [COLOR=#000000][COLOR=#0000BB]<?php  
    
                [/COLOR][COLOR=#FF8000]/* hat Wert 1  */                        
                [/COLOR][COLOR=#0000BB]$user_id_list [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]osc_item_user_id[/COLOR][COLOR=#007700]();                     
               [/COLOR][COLOR=#FF8000]            
                [/COLOR][COLOR=#0000BB]$itemsPerPage [/COLOR][COLOR=#007700]= ([/COLOR][COLOR=#0000BB]Params[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]getParam[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'itemsPerPage'[/COLOR][COLOR=#007700])!=[/COLOR][COLOR=#DD0000]''[/COLOR][COLOR=#007700])?[/COLOR][COLOR=#0000BB]Params[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]getParam[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'itemsPerPage'[/COLOR][COLOR=#007700]):[/COLOR][COLOR=#0000BB]5[/COLOR][COLOR=#007700];
                [/COLOR][COLOR=#0000BB]$page [/COLOR][COLOR=#007700]= ([/COLOR][COLOR=#0000BB]Params[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]getParam[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'iPage'[/COLOR][COLOR=#007700])!=[/COLOR][COLOR=#DD0000]''[/COLOR][COLOR=#007700])?[/COLOR][COLOR=#0000BB]Params[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]getParam[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'iPage'[/COLOR][COLOR=#007700]):[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
                [/COLOR][COLOR=#0000BB]$total_items [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]Item[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]newInstance[/COLOR][COLOR=#007700]()->[/COLOR][COLOR=#0000BB]countByUserIDEnabled[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'userId'[/COLOR][COLOR=#007700]]);
                [/COLOR][COLOR=#0000BB]$total_pages [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]ceil[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$total_items[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]$itemsPerPage[/COLOR][COLOR=#007700]);
                [/COLOR][COLOR=#0000BB]$items [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]Item[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]newInstance[/COLOR][COLOR=#007700]()->[/COLOR][COLOR=#0000BB]findByUserIDEnabled[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'userId'[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]$page[/COLOR][COLOR=#007700]*[/COLOR][COLOR=#0000BB]$itemsPerPage[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$itemsPerPage[/COLOR][COLOR=#007700]);    
    
                [/COLOR][/COLOR][COLOR=#000000][COLOR=#0000BB]
                [/COLOR][COLOR=#FF8000]/* zeigt 2 mehrdimensionale Arrays mit Inhalt an  */    
               //print_r ($items);    
              [/COLOR][/COLOR][COLOR=#000000][COLOR=#0000BB]     
               
              [/COLOR][COLOR=#FF8000]// [/COLOR][/COLOR][COLOR=#000000][COLOR=#FF8000][COLOR=#000000][COLOR=#0000BB]beide Arrays ausgeben [/COLOR][/COLOR] 
              for($index = 0; $index < count($items); $index++ ) 
                [/COLOR][COLOR=#007700]
                {[/COLOR][/COLOR]  [COLOR=#000000][COLOR=#007700][COLOR=#000000][COLOR=#0000BB]?>[/COLOR][/COLOR]   
                                                   [/COLOR][/COLOR]              
                <div class="ui-item ui-item-list">
                    <div class="frame">
                        <a href="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]item_url[/COLOR][COLOR=#007700]() ; [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]">
                        [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]if( [/COLOR][COLOR=#0000BB]images_enabled_at_items[/COLOR][COLOR=#007700]() ) { [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                            [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]if( [/COLOR][COLOR=#0000BB]count_item_resources[/COLOR][COLOR=#007700]() ) { [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                                <img src="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]resource_thumbnail_url[/COLOR][COLOR=#007700]() ; [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]" title="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]item_title[/COLOR][COLOR=#007700](); [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]" alt="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]item_title[/COLOR][COLOR=#007700](); [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]"/>
                            [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]} else { [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                                <img src="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]current_web_theme_url[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'images/no_photo.gif'[/COLOR][COLOR=#007700]) ; [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]" alt="" title=""/>
                            [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]} [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                        [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]} else { [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                            <img src="[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]current_web_theme_url[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'images/no_photo.gif'[/COLOR][COLOR=#007700]) ; [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]" alt="" title=""/>
                        [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]} [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                        <div class="type">[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]item_category[/COLOR][COLOR=#007700](); [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]</div>
                        [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]if( [/COLOR][COLOR=#0000BB]price_enabled_at_items[/COLOR][COLOR=#007700]() ) { [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]<div class="price">[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000BB]item_formated_price[/COLOR][COLOR=#007700]() ; [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]</div> [COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]} [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
                        </a>
                    </div>
                    
                </div> 
          [COLOR=#000000][COLOR=#0000BB]<?php    [/COLOR][COLOR=#007700]} [/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
    Ich bekomme nur ein Array raus, das dann aber zweimal angezeigt wird.
Lädt...
X