PHP code example of simpleverify / simpleverify-php
1. Go to this page and download the library: Download simpleverify/simpleverify-php 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/ */
simpleverify / simpleverify-php example snippets
use SimpleVerify\Client;
$client = new Client('vk_test_your_api_key_here');
// Send an SMS verification
$verification = $client->verifications->send([
'type' => 'sms',
'destination' => '+15551234567',
]);
echo $verification->verificationId; // "a1b2c3d4-..."
echo $verification->status; // "pending"
// Check the code the user entered
$result = $client->verifications->check($verification->verificationId, '482913');
if ($result->valid) {
echo 'Verified!';
}
// With just an API key
$client = new Client('vk_test_...');
// With options
$client = new Client([
'api_key' => 'vk_test_...',
'base_url' => 'https://api.simpleverify.io', // default
'timeout' => 30, // default, in seconds
]);
// Static factory
$client = \SimpleVerify\SimpleVerify::make('vk_test_...');