Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: imap_ping - Manual
[go: Go Back, main page]

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

search for in the

imap_qprint" width="11" height="7"/> <imap_open
Last updated: Mon, 05 Feb 2007

view this page in

imap_ping

(PHP 4, PHP 5)

imap_ping — IMAP ストリームがアクティブかどうかを調べる

説明

bool imap_ping ( resource imap_stream )

imap_ping() はストリームに ping を行い、 まだアクティブであるかどうかを調べます。これにより新しいメールの到着を知ることもあります。 これは、定期的に「メールのチェック」を行い、サーバとの 「接続を保持し続ける」ためのお勧めの方法です。

パラメータ

imap_stream

imap_open() が返す IMAP ストリーム。

返り値

ストリームがまだ有効であれば TRUE を、そうでなければ FALSE を返します。

例 964. imap_ping() の例

<?php

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

// しばらく休んだ後
if (!imap_ping($imap)) {
  
// 再接続の処理
}

?>



add a note add a note User Contributed Notes
imap_ping
28-Dec-2002 09: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" width="11" height="7"/> <imap_open
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites