Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Datum Vergleich

Empfohlene Antworten

Veröffentlicht

Ich möchte in PHP ein Programm schreiben. Es soll ein von mir festgelegtes Datum (zB. 22.05.2001) überprüfen. Falls das Datum vorhanden ist soll eine 1 augeben und falls nicht (zB. 32.05.2000)soll eine 0 ausgeben. Es soll eine Funktion geben die das festgelegte Datum prüft. Weis einer wie diese Funktion heist oder kennt jemand eine andere möglichkeit das Datum zu überprüfen.

Hallo,

naheliegend ist checkdate :D

(PHP 3, PHP 4 >= 4.0.0)

checkdate -- Validate a gregorian date/time

Description

bool checkdate ( int month, int day, int year)

Returns TRUE if the date given is valid; otherwise returns FALSE. Checks the validity of the date formed by the arguments. A date is considered valid if:

year is between 1 and 32767 inclusive

month is between 1 and 12 inclusive

Day is within the allowed number of days for the given month. Leap years are taken into consideration.

Gruß Jaraz

<?

if(checkdate ( 08, 25, 2000))

{

echo "1";

}

else

{

echo "0";

}

?>

Da Das Datum gültig ist müsste normalerweise eine 1 ausgegeben werden. Es kommt aber eine 0.

Wiso????

Original geschrieben von Larusso7

<?

if(checkdate ( 08, 25, 2000))

Die Funktion lautet: bool checkdate ( int month, int day, int year)

Ich nehme mal an er interpretiert 08 nicht als int.

Mich wundert, das er da keine Fehlermeldung ausgibt.

Ich kann es im Moment nicht testen, da ich hier keinen Webserver habe.

Gruß Jaraz

yep.. liegt an der 08... bloeder bug :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.