1. Go to this page and download the library: Download ez-php/feature-flags 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/ */
use EzPhp\FeatureFlags\Flag;
if (Flag::enabled('new-checkout')) {
// show new checkout flow
}
if (Flag::disabled('dark-mode')) {
// show light theme
}
// Context-aware evaluation (e.g. per-user gradual rollouts)
if (Flag::enabledFor('beta-search', $user->id)) {
// show beta search to this user
}
if (Flag::disabledFor('new-ui', $user->id)) {
// show legacy UI for this user
}
$all = Flag::all(); // ['new-checkout' => true, 'dark-mode' => false]