Zu den Aufzeichnungen der tutorials.de-Live-Workshops
ERLEDIGT
JA
ANTWORTEN
2
ZUGRIFFE
91
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    mgraf mgraf ist offline Mitglied Gold
    Registriert seit
    May 2003
    Beiträge
    202
    Hallo,
    kann man diese Ausgabe abkürzen, so können ja jede Mengy copy+paste fehler entstehen:

    PHP-Code:
    $count count($result);
    echo 
    '<table border="1" align="center">';
    for(
    $i=0$i $count$i++) {
        echo 
    '<tr>';
            if(
    $result[$i]->fileName != NULL)echo '<td><strong>Filename:</strong> '.$result[$i]->fileName '</td>';
            if(
    $result[$i]->referiert != NULL)echo '<td><strong>referiert:</strong> '.$result[$i]->referiert '</td>';
            if(
    $result[$i]->URL != NULL)echo '<td><strong>URL:</strong> '.$result[$i]->URL '</td>';
            if(
    $result[$i]->ISBN != NULL)echo '<td><strong>ISBN:</strong> '.$result[$i]->ISBN '</td>';
            if(
    $result[$i]->verlag != NULL)echo '<td><strong>verlag:</strong> '.$result[$i]->verlag '</td>';
            if(
    $result[$i]->seiteBis != NULL)echo '<td><strong>seiteBis:</strong> '.$result[$i]->seiteBis '</td>';
            if(
    $result[$i]->seiteVon != NULL)echo '<td><strong>seiteVon:</strong> '.$result[$i]->seiteVon '</td>';
            if(
    $result[$i]->ort != NULL)echo '<td><strong>ort:</strong> '.$result[$i]->ort '</td>';
            if(
    $result[$i]->land != NULL)echo '<td><strong>land:</strong> '.$result[$i]->land '</td>';
            if(
    $result[$i]->veranstaltung != NULL)echo '<td><strong>veranstaltung:</strong> '.$result[$i]->veranstaltung '</td>';
            if(
    $result[$i]->band->URL != NULL)echo '<td><strong>band:</strong> '.$result[$i]->band '</td>';
            if(
    $result[$i]->ausgabe != NULL)echo '<td><strong>ausgabe:</strong> '.$result[$i]->ausgabe '</td>';
            if(
    $result[$i]->issue != NULL)echo '<td><strong>issue:</strong> '.$result[$i]->issue '</td>';
            if(
    $result[$i]->volume != NULL)echo '<td><strong>volume:</strong> '.$result[$i]->volume '</td>';
            if(
    $result[$i]->journal != NULL)echo '<td><strong>journal:</strong> '.$result[$i]->journal '</td>';
            if(
    $result[$i]->werkTyp != NULL)echo '<td><strong>werkTyp:</strong> '.$result[$i]->werkTyp '</td>';
            if(
    $result[$i]->herausgeber != NULL)echo '<td><strong>herausgeber:</strong> '.$result[$i]->herausgeber '</td>';
            if(
    $result[$i]->zeitraum != NULL)echo '<td><strong>zeitraum:</strong> '.$result[$i]->zeitraum '</td>';
            if(
    $result[$i]->veröffentlichung != NULL)echo '<td><strong>veröffentlichung:</strong> '.$result[$i]->veröffentlichung '</td>';
            if(
    $result[$i]->publikationsTyp != NULL)echo '<td><strong>publikation:</strong> '.$result[$i]->publikationsTyp '</td>';
            if(
    $result[$i]->titel != NULL)echo '<td><strong>titel:</strong> '.$result[$i]->titel '</td>';
            if(
    $result[$i]->monat != NULL)echo '<td><strong>monat:</strong> '.$result[$i]->monat '</td>';
            if(
    $result[$i]->jahr != NULL)echo '<td><strong>jahr:</strong> '.$result[$i]->jahr '</td>';
            if(
    $result[$i]->institut != NULL)echo '<td><strong>institut:</strong> '.$result[$i]->institut '</td>';
            if(
    $result[$i]->wissenschafter != NULL)echo '<td><strong>wissenschafter:</strong> '.$result[$i]->wissenschafter '</td>';
            if(
    $result[$i]->gesamt != NULL)echo '<td><strong>gesamt:</strong> '.$result[$i]->gesamt '</td>';
        echo 
    '</tr>';
     
    }
    echo 
    '</table>'

    lg
    michi
     

  2. #2
    Avatar von Flex
    Flex Flex ist offline (aka Felix Jacobi)
    tutorials.de Moderator
    Registriert seit
    Nov 2001
    Ort
    Wuppertal
    Beiträge
    5.295
    Blog-Einträge
    65
    Du könntest per foreach() durchiterieren, aber die Leistung bei verschachtelten Schleifen ist auch nicht immer die Beste.
    Aber du würdest Code sparen.

    Übrigens reicht ein einfaches
    PHP-Code:
    if($var
    aus.
     
    KIDS Kinderbetreuungsdienst
    Xing

    "When you play the game of thrones, you win or you die. There is no middle ground."
    by Cersei Lannister in "A Game Of Thrones"

  3. #3
    mgraf mgraf ist offline Mitglied Gold
    Registriert seit
    May 2003
    Beiträge
    202
    Schade. Aber kürzer is kürzer

    Danke
    lg
    michi
     

Ähnliche Themen

  1. as3: Kann ich dies irgendwie abkürzen?
    Von cKasper im Forum Flash Plattform
    Antworten: 4
    Letzter Beitrag: 10.03.09, 22:12
  2. Text in Div per ... abkürzen
    Von AlexMineiro im Forum PHP
    Antworten: 7
    Letzter Beitrag: 26.02.09, 13:38
  3. MYSQL SELECT Abkürzen
    Von -André- im Forum Content Management Systeme (CMS)
    Antworten: 1
    Letzter Beitrag: 29.05.08, 10:22
  4. URL abkürzen - bzw. abgekürzt darstellen.
    Von maxausDuesseldorf im Forum HTML-Editoren
    Antworten: 7
    Letzter Beitrag: 21.12.04, 21:09
  5. Last News Text abkürzen?
    Von vodka im Forum PHP
    Antworten: 4
    Letzter Beitrag: 30.03.04, 10:06