1. Go to this page and download the library: Download aegisora/in-array-rule 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/ */
aegisora / in-array-rule example snippets
in_array($value, $array, $strict)
use Aegisora\Rules\InArrayRule;
use Aegisora\RuleContract\Models\Context;
$rule = InArrayRule::create(['apple', 'banana', 'orange',]);
$result = $rule->validate(Context::create('banana'));
if ($result->isValid()) {
// value exists in array
} else {
// value not found
}