I have this code I don't know why I get error from it.
if( ! in_array($repeatType, ['monthly', 'weekly', 'daily'])){
// do somehting
}
$monthly = ['two_years' => 26, 'offset_const' => 4, 'add_unite' => 'weeks'];
$weekly = ['two_years' => 52*2, 'offset_const' => 1, 'add_unite' => 'weeks'];
$daily = array('two_years' => 365*2, 'offset_const' => 1, 'add_unite' => 'days');
for ($i=0; $i < $$repeatType['two_years']; $i++) { #<--- here I get the error
// ..... // rest of the code
This is so weird cause I have checked var_dump($$repeatType)
output, it seems fine:
array(3){["two_years"]=>int(730)["offset_const"]=>int(1)["add_unite"]=>string(4)"days"}