connection_status()

It returns the current connection status

Example

<?php
echo connection_status ();
?>

It returns one of the follows

0 – CONNECTION_NORMAL – connection is running normally
1 – CONNECTION_ABORTED – connection is aborted by user or network error
2 – CONNECTION_TIMEOUT –  connection timed out
3 – CONNECTION_ABORTED & CONNECTION_TIMEOUT

xpath()

It runs an XPath query on XML data

Example

<?php
$xml = simplexml_load_file(“test.xml”);
$xml->registerXPathNamespace(“msg”,”http://www.phpcodez.com&#8221;);
$result = $xml->xpath(“msg:web”);
?>

XML

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<web>
<server ver=”5″>Apache</server>
<lan>PHP</lan>
<client>Javascript</client>
</web>