Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem ze składnią
emillio
post 4.08.2010, 02:58:13
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 4.08.2010

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


Wita Was,
Czy możecie mi pomóc z zapisaniem poniższego kodu w PHP ten, który mam to kod do zastosowania w templecie
  1. {if !empty($auth.usergroup_ids)}
  2. {foreach name="auth.usergroup_ids" from=$auth.usergroup_ids item="groups"}
  3. {/foreach}
  4.  
  5. {if $groups==3}
  6.  
  7. zrób cos tam
  8.  
  9. {/if}
  10.  
  11. {/if}
  12.  


Jak powyższy zapis powinien wyglądać w PHP?
Z góry dzięki za pomoc dopiero się uczę smile.gif
Pozdrawiam,
Kamil
Go to the top of the page
+Quote Post
starach
post 4.08.2010, 05:04:06
Post #2





Grupa: Zarejestrowani
Postów: 999
Pomógł: 30
Dołączył: 14.01.2007
Skąd: wiesz ?

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


Tak:
  1. <?php if(!empty($auth['usergoup_ids'])): ?>
  2. <?php foreach($auth['usergoup_ids'] as $groups): ?>
  3. <?php if($groups == 3): ?>
  4.  
  5. <?php endif; ?>
  6. <?php endforeach; ?>
  7. <?php endif; ?>

Lub tak:
  1. if(!empty($auth['usergoup_ids']))
  2. {
  3. foreach($auth['usergoup_ids'] as $groups)
  4. {
  5. if($groups == 3)
  6. {
  7.  
  8. }
  9. }
  10. }
RTFM błagam winksmiley.jpg
Go to the top of the page
+Quote Post
emillio
post 4.08.2010, 11:58:28
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 4.08.2010

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


thanx I will next time smile.gif
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 09:01