PHP code example of wccplatform / otphp
1. Go to this page and download the library: Download wccplatform/otphp 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/ */
wccplatform / otphp example snippets
use OTPHP\TOTP;
$otp = TOTP::create();
echo 'The current OTP is: '.$otp->now();
$googleChartUri = $totp->getQrCodeUri();
echo "<img src='{$googleChartUri}'>";
$otp->verify($input); // Returns true if the input is verified, otherwise false.