1. Go to this page and download the library: Download switchover/php-sdk 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/ */
switchover / php-sdk example snippets
// create a client, per default the client will cache the toggles 60 seconds
$client = new SwitchoverClient('<SDK-KEY');
//get some toggle values
$featureValue = $client->toggleValue('<TOGGLE-NAME>', false);
//or with context if you have specific (user) conditions
$context = new Context();
$context->set('email', '[email protected]');
$isFeatureVisible = $client->toggleValue('<OTHER-FLAG>', false, $context);
if ($isFeatureVisible) {
// ...do something
}