Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Nie działa funkcja
Bobek1910
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 3
Dołączył: 14.04.2009
Skąd: Wziąć piwo?

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


Witam!

Napisałem oto taką funkcję:

CODE
function counttime()

{

global $time;



$arrHour = explode(":", $time);

$arrTime2 = array(8, 10, 12, 14, 16, 18, 20, 22, 24);

foreach ($arrTime2 as $intTime)

{

if ($arrHour[0] < $intTime)

{

$intWait = (($intTime - $arrHour[0]) * 60) - $arrHour[1];

$intHours = floor($intWait / 60);

$intMinutes = $intWait % 60;

break;

}

}

$arrTime = array('', '');

if ($intHours < 1)

{

$arrTime[0] = '';

}

if ($intHours == 1)

{

$arrTime[0] = $intHours.echo 'godzina';

}

if ($intHours > 1 && $intHours < 5)

{

$arrTime[0] = $intHours.echo 'godziny';

}

if ($intHours > 4)

{

$arrTime[0] = $intHours.echo 'godzin';

}

if ($intMinutes < 1)

{

$arrTime[1] = '';

}

if ($intMinutes == 1)

{

$arrTime[1] = $intMinutes.echo 'minuta';

}

if (($intMinutes > 1 && $intMinutes < 5) || ereg("^[2-5][2-4]*$", $intMinutes))

{

$arrTime[1] = $intMinutes.echo 'minuty';

}

if (($intMinutes > 4 && $intMinutes < 20) || ereg("^[2-5][5-9]*$", $intMinutes) || ereg("^[2-5][0-1]*$", $intMinutes))

{

$arrTime[1] = $intMinutes.echo 'minut';

}



return $arrTime;

}


i ten skrypt nie dość, że nie chce działać, to przerywa działanie innych skryptów po załadowaniu tego...

Proszę o pomoc

Bobek
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: 22.08.2025 - 12:23