PHP code example of lexinzector / aboutguest
1. Go to this page and download the library: Download lexinzector/aboutguest 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/ */
lexinzector / aboutguest example snippets
$this->load($file_and_array_name)
$this->set_ip()
$this->set_browser()
$this->set_operating_system()
$this->set_robot()
$this->set_mobile()
use \Lexinzector\AboutGuest\AboutGuest;
// useragent autodetection
$AboutGuest = new AboutGuest;
// custom useragent
$useragent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36';
$AboutGuest = new AboutGuest($useragent);
echo 'User Agent: ' . $AboutGuest->agent . '<br />';
echo 'IP: ' . $AboutGuest->ip . '<br />';
echo 'Browser: ' . $AboutGuest->browser . '<br />';
echo 'Browser version: ' . $AboutGuest->version . '<br />';
echo 'Operating System: ' . $AboutGuest->operating_system . '<br />';
echo 'OS version: ' . $AboutGuest->os_version . '<br />';
echo 'I am a robot? ' . $AboutGuest->is_robot . '<br />';
echo 'Robot belongs: ' . $AboutGuest->robot . '<br />';
echo 'Logged in from a mobile phone? ' . $AboutGuest->is_mobile . '<br />';
echo 'Mobile phone: ' . $AboutGuest->mobile . '<br />';