PHP code example of squareconcepts / uptime-monitor
1. Go to this page and download the library: Download squareconcepts/uptime-monitor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
squareconcepts / uptime-monitor example snippets
// Usage description here
$uptimeMonitor = \Squareconcepts\UptimeMonitor\UptimeMonitor::make('https://www.google.com');
if($uptimeMonitor->isHasSsl()) {
echo 'I\'m secure!';
} else {
echo 'Oops, I\'m not secure!'
}
if($uptimeMonitor->isOnline()) {
echo 'I\'m online!';
} else {
echo 'Oops, I\'m offline!'
}
echo $uptimeMonitor->expiresIn(); // 20 days from now
$months = $uptimeMonitor->expiresIn('months');
$weeks = $uptimeMonitor->expiresIn('weeks');
$days = $uptimeMonitor->expiresIn('days');
$hours = $uptimeMonitor->expiresIn('hours');
$minutes = $uptimeMonitor->expiresIn('minutes');
$seconds = $uptimeMonitor->expiresIn('seconds');