Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
[PHP] expecting ',' or ';'
#11
Cytat:
Kod:
<?php

function stworz_tabele2($dane, $border=1, $cellpadding=4, $cellspacing=4) {
    echo „<table border = ””.$border.”” cellpadding = ””.$cellpadding”.”” cellspacing = ””.$cellspacing.””>”
    reset($dane);
    $wartosc = current($dane);
    
    while ($wartosc) {
    echo „<tr><td>”.$wartosc.”</td></tr>n”;
    $wartosc=next($dane);
    }
echo „</table>”;
}

$moja_tablica = array(‘Wiersz 1.’, ‘Wiersz 2.’, ‘Wiersz 3.’);
stworz_tabele2($moja_tablica, 3, 8, 8)

?>

Poprawnie ;]

Kod:
<?php

function stworz_tabele2 ($dane, $border=1, $cellpadding=4, $cellspacing=4)
{
    echo '<table border="'.$border.'" cellpadding="'.$cellpadding.'" cellspacing="'.$cellspacing.'">'; // tu był " przed kropką, zamiast za ;]
    reset($dane);
    $wartosc = current($dane);
    
    while ($wartosc)
    {
    echo '<tr><td>'.$wartosc.'</td></tr>'; // tu \n nie zadziala, chyba, ze uzyjesz "
    $wartosc=next($dane);
    }
echo '</table>';
}

$moja_tablica = array('Wiersz 1.', 'Wiersz 2.', 'Wiersz 3.');
stworz_tabele2($moja_tablica, 3, 8, 8)

?>
Odpowiedz


Wiadomości w tym wątku
[PHP] expecting ',' or ';' - przez Gherthus - 01-06-2010, 02:10
RE: [PHP] expecting ',' or ';' - przez dziamber - 01-06-2010, 02:30
RE: [PHP] expecting ',' or ';' - przez Gherthus - 01-06-2010, 02:33
RE: [PHP] expecting ',' or ';' - przez razorskate - 02-06-2010, 17:49
RE: [PHP] expecting ',' or ';' - przez dziamber - 02-06-2010, 22:56
RE: [PHP] expecting ',' or ';' - przez Gherthus - 04-06-2010, 18:13
RE: [PHP] expecting ',' or ';' - przez Folmi - 19-06-2010, 23:20
RE: [PHP] expecting ',' or ';' - przez KeeL - 19-06-2010, 23:55
RE: [PHP] expecting ',' or ';' - przez Jupiter - 20-06-2010, 00:22
RE: [PHP] expecting ',' or ';' - przez Folmi - 20-06-2010, 01:23
RE: [PHP] expecting ',' or ';' - przez 3lanc - 27-06-2010, 21:44

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl