quiet-state-72429
05/23/2022, 12:45 PMdefine("FEATURES_ENDPOINT", '<https://cdn.growthbook.io/api/features/key_prod_5926******fdba>');
$apiResponse = json_decode(file_get_contents(FEATURES_ENDPOINT), true);
$features = $apiResponse["features"];
// generate 100 fake requests and allow specific feature based on ID attribute.
for($i = 0; $i<100; $i++) {
$growthbook = Growthbook::create()
->withFeatures($features)
->withAttributes([
'id' => rand(1, 100)
]);
if ($growthbook->isOn("test-feature-ab")) {
echo "It's on! <br>";
} else {
echo "It's off :( <br>";
}
}
Its working fine, I’m getting On
and Off
for specific set of users and its totally random.
now, the question is that how can I feed those On/Off to the experiments, so that I can get report and statistics.
Note: I’m using PHP SDK.future-teacher-7046
quiet-state-72429
05/23/2022, 1:06 PMfuture-teacher-7046
quiet-state-72429
05/23/2022, 1:36 PMfuture-teacher-7046