Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Problem ze zmienną
Mody23
post
Post #1





Grupa: Zarejestrowani
Postów: 276
Pomógł: 0
Dołączył: 30.06.2010

Ostrzeżenie: (10%)
X----


Witam!

Mój problem polega na tym, że mam pewien kod:

  1. if ( $profiledata['user_spend_time'] >= 24 * 3600 )
  2. {
  3. $spend_time = $lang['Days'] . ': ' . round(($profiledata['user_spend_time'] / 24 / 60 / 60), 1);
  4. }
  5. else
  6. {
  7. $spend_time = $lang['Hours'] . ': ' . round(($profiledata['user_spend_time'] / 60 / 60), 1);
  8. }
  9. }


i chcę w miejsce gdzie w jest zmienna $tutaj:

  1. if ( $profiledata['user_spend_time'] >= 24 * 3600 )
  2. {
  3. $spend_time = $lang['Days'] . ': ' . round(($profiledata['user_spend_time'] / 24 / 60 / 60),$tutaj 1);
  4. }
  5. else
  6. {
  7. $spend_time = $lang['Hours'] . ': ' . round(($profiledata['user_spend_time'] / 60 / 60), 1);
  8. }
  9. }


wyświetlić napis: "Godzin". Ale niestety, wstawianie tam:

  1. $lang['Hours'] . ': ' .


czy też za pomocą zmiennej, czyli przed początkującym if'em coś takiego:
  1. $tutaj = $lang['Days'] . ': ' .;

Nie skutkuje...Cały czas mam jakieś błędy. Jak mogę to zrobić?


Obecnie otrzymuję taki efekt:

Dni: 14,1

a chcę: Dni:14, Godzin:1

Ten post edytował Mody23 7.07.2011, 22:57:25
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: 15.09.2025 - 19:31