Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] wyswietlanie forem tablicy
hhg
post
Post #1





Grupa: Zarejestrowani
Postów: 316
Pomógł: 0
Dołączył: 5.07.2006

Ostrzeżenie: (0%)
-----


  1. <?php
  2. for ( $i=1;$i<=3;$i++ ) {
  3.  
  4. $datahostingformat = date( 'd-m-Y', strtotime( $row['hosting_until[$i]'] ) ); 
  5.  
  6. if ( !empty($row['hosting[$i]']) && $row['hosting_until[$i]'] >= date('Ymd') ) {
  7. echo '<LI> plan hostingowy <b>"' . $row['hosting[$i]'] . '"</b> jest opłacony do dnia <i>' . $datahostingformat . '</i><br>';
  8. } elseif ( !empty($row['hosting[$i]']) && $row['hosting_until[$i]'] >= date('Ymd') ) {
  9. echo '<LI> zalegasz z opłatami za plan hostingowy "' . $row['hosting[$i]'] . '" od dnia <i>' . $datahostingformat . '</i><br>' ;
  10. }
  11.  
  12. }
  13. ?>


dostaję błąd że zapis z [$i] jest nieprawidłowy, dlaczego?

Ten post edytował hhg 9.08.2006, 19:36:31
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
hhg
post
Post #2





Grupa: Zarejestrowani
Postów: 316
Pomógł: 0
Dołączył: 5.07.2006

Ostrzeżenie: (0%)
-----


  1. <?php
  2. for ( $i=1;$i<=3;$i++ ) {
  3.  
  4. $datahostingformat = date( 'd-m-Y', strtotime($row[hosting_until[$i]]) ); 
  5.  
  6. if ( !empty($row[hosting[$i]]) && $row[hosting_until[$i]] >= date('Ymd') ) {
  7. echo '<LI> plan hostingowy <b>"' . $row[hosting[$i]] . '"</b> jest opłacony do dnia <i>' . $datahostingformat . '</i><br>';
  8. } elseif ( !empty($row[hosting[$i]]) && $row[hosting_until[$i]] >= date('Ymd') ) {
  9. echo '<LI> zalegasz z opłatami za plan hostingowy "' . $row[hosting[$i]] . '" od dnia <i>' . $datahostingformat . '</i><br>' ;
  10. }
  11.  
  12. }
  13. ?>
zmieniłem jak wyżej ale nadal bład:

Parse error: syntax error, unexpected '[', expecting ']'
i dotyczy linii
$datahostingformat = date( 'd-m-Y', strtotime($row[hosting_until[$i]]) );
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 12.10.2025 - 21:32