{"id":1645,"date":"2016-01-21T11:21:48","date_gmt":"2016-01-21T11:21:48","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=1645"},"modified":"2022-02-17T07:14:02","modified_gmt":"2022-02-17T07:14:02","slug":"pinging-from-a-web-page","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/ping\/pinging-from-a-web-page","title":{"rendered":"Pinging from a web page"},"content":{"rendered":"<h4>\nExample using fping<br \/>\n<\/h4>\n<p>\n(You could use piong&nbsp;instead, but if you install fping&nbsp;you can limit the time)\n<\/p>\n<pre>\r\n<code>\r\n&lt;?php\r\n\t$cfg_endpoint = &quot;www.google.com&quot;;\r\n\techo (&quot;&lt;p&gt;Pinging $cfg_endpoint:&lt;\/p&gt;&quot;);\r\n\techo (&quot;&lt;p&gt;Result:&lt;\/p&gt;&quot;);\r\n\t\/\/----- DO THE PING -----\r\n\t$output = shell_exec(&quot;fping -c1 -t750 $cfg_endpoint 2&gt;&amp;1&quot;);\r\n\techo &quot;&lt;pre&gt;$output&lt;\/pre&gt;&quot;;\r\n?&gt;\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Example using fping (You could use piong&nbsp;instead, but if you install fping&nbsp;you can limit the time) &lt;?php $cfg_endpoint = &quot;www.google.com&quot;; echo (&quot;&lt;p&gt;Pinging $cfg_endpoint:&lt;\/p&gt;&quot;); echo (&quot;&lt;p&gt;Result:&lt;\/p&gt;&quot;); \/\/&#8212;&#8211; DO THE PING &#8212;&#8211; $output = shell_exec(&quot;fping -c1 -t750 $cfg_endpoint 2&gt;&amp;1&quot;); echo &quot;&lt;pre&gt;$output&lt;\/pre&gt;&quot;; ?&gt; &nbsp;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137],"tags":[],"class_list":["post-1645","post","type-post","status-publish","format-standard","hentry","category-ping"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=1645"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1645\/revisions"}],"predecessor-version":[{"id":1646,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1645\/revisions\/1646"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=1645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=1645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=1645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}