if variable matches to a variable with multiple values
Posted: 15 Sep 2021 23:14
Is there a way, that if I get a list of values like so:
And it returns the values for $overwrite as:
1.txt
2.txt
3.txt
That I can compare a variable with a single value to the list of values in $overwrite, and if it matches any of the values in $overwrite, than it performs the action, perhaps like so (though I cannot get it to work)?
Code: Select all
$overwrite = get("selecteditemsnames", "<crlf>");
1.txt
2.txt
3.txt
That I can compare a variable with a single value to the list of values in $overwrite, and if it matches any of the values in $overwrite, than it performs the action, perhaps like so (though I cannot get it to work)?
Code: Select all
$file = 2.txt;
if (regexmatches($file, $overwrite, <crlf>)) {
$contents = Action: OVERWRITE;
}