I have an array of blog_ids and i want to navigate to the previous and next blog_id in that array.
foreach($blog_ids as $blog_id) {
echo $blog_id.'<br />';
}
// output:
id_20200523214047
id_20200523003107
id_20200521125410
id_20200521123813
id_20200514222532
From the current page, i grab the id with $_GET['page'];
echo $_GET['page'];
// ouput
id_20200521125410 (3rd value of array)
How can i now navigate to the previous and next value in that array, from the current id i am?
Previous should be: id_20200523003107 and next should be id_20200521123813
$blog_idsgets built but that likely could be inefficient.