PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imap_qprint> <imap_open
Last updated: Fri, 05 Sep 2008

view this page in

imap_ping

(PHP 4, PHP 5)

imap_pingPrüft einen IMAP-Stream auf Funktionalität

Beschreibung

bool imap_ping ( resource $imap_stream )

imap_ping() 'pingt' einen IMAP-Stream um zu sehen ob dieser noch aktiv und funktional ist. Sie kann neue Nachrichten entdecken, ein imap_ping() ist daher die bevorzugte Methode für periodische Prüfungen auf neue Nachrichten sowie als Keepalive Signal für Server die Verbindungen nach einer gewissen Zeit der Inaktivität beenden.

Parameter-Liste

imap_stream

Eine von imap_open() zurückgegebene IMAP-Verbindung.

Rückgabewerte

Liefert TRUE wenn der Stream noch funktioniert, sonst FALSE.

Beispiele

Beispiel #1 imap_ping() Example

<?php

$imap 
imap_open("{imap.example.org}""mailadmin""password");

// nach einer gewissen Zeit
if (!imap_ping($imap)) {
    
// Verbindung wieder aufbauen
}

?>



add a note add a note User Contributed Notes
imap_ping
27-Dec-2002 04:28
This is a great solution for a webmail class if you want to make sure that a user is still logged in. Example:

<?php
if(!(imap_ping($stream)) {
die(
"The user is no longer logged in.");
?>

imap_qprint> <imap_open
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites