3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timePeriods = array( 'weekly' => 1, 'fortnightly' => 2, 'fourweekly' => 4, 'bianually' => 26, 'anually' => 52 ); $periods = array_keys($timePeriods); $recordName = 'ni_fortweekly_earning_limit'; $regex = '(' . implode('|', $periods) . ')'; $a = preg_match($regex, $recordName); var_dump($a);
based on OMTAC
Output for 4.3.0 - 7.2.0
int(1)