Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pytanie o składnie, warunek ? X : Y
markonix
post
Post #1





Grupa: Zarejestrowani
Postów: 2 707
Pomógł: 290
Dołączył: 16.12.2008
Skąd: Śląsk

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


  1. 'value' => set_value('data[goals]', isset($result->goals) ? $result->goals : isset($default->goals) ? $default->goals : ''),

głównie mi chodzi o fragment
  1. isset($result->goals) ? $result->goals : isset($default->goals) ? $default->goals : ''

Czyli podwójnie zagnieżdżone.
Mimo że $result->goals istnieje to niestety wyrażenie zwraca NULL (nie pusty string).
PHP 5.2.
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: 11.10.2025 - 18:09