i have a code like this :
$step_master = [1, 2, 3, 4, 5, 6, 7, 8, 9];
$step_now = 4;
$step_before = ????;
$step_next = ????;
how can i get the next value or the previous value from the $step_now
in $step_master
so the output should be like this :
Now : 4
Previous : 3
Next : 5
i've tried using next()
but it don't have another parameter for $step_now
any help will be appreciated
thanks