Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 3786

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Check if the IMAP stream is still active</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imap-open.html">imap_open</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imap-qprint.html">imap_qprint</a></div>
 <div class="up"><a href="ref.imap.html">IMAP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.imap-ping" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_ping</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">imap_ping</span> &mdash; <span class="dc-title">Check if the IMAP stream is still active</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-ping-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>imap_ping</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$imap_stream</code></span>
   )</div>

  <p class="para rdfs-comment">
    <span class="function"><strong>imap_ping()</strong></span> pings the stream to see if it&#039;s still
   active. It may discover new mail; this is the preferred method for a
   periodic &quot;new mail check&quot; as well as a &quot;keep alive&quot; for servers which
   have inactivity timeout.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-ping-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>
<span class="term"><em><code class="parameter">
imap_stream</code></em></span><dd>
<p class="para">An IMAP stream returned by
 <span class="function"><a href="function.imap-open.html" class="function">imap_open()</a></span>.</p></dd>
</dt>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-ping-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> if the stream is still alive, <strong><code>FALSE</code></strong> otherwise.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.imap-ping-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3369">
    <p><strong>Example #1  <span class="function"><strong>imap_ping()</strong></span> Example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$imap&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"mailadmin"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;after&nbsp;some&nbsp;sleeping<br /></span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">imap_ping</span><span style="color: #007700">(</span><span style="color: #0000BB">$imap</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;do&nbsp;some&nbsp;stuff&nbsp;to&nbsp;reconnect<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imap-open.html">imap_open</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imap-qprint.html">imap_qprint</a></div>
 <div class="up"><a href="ref.imap.html">IMAP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>