Skip to content

What exactly the unset() function is doing here?

This code takes a number like 2017 and returns the NEXT highest (not total highest, like 7021) number, so in this case 2071 I understand every bit of except the if (($key = array_search($currentNumber, $tmpArray, true)) !== false) { unset($tmpArray[$key]); — what exactly is happening here? Please help a…

PHP function, always returns same output

below there’s a code that I use very often on my website (it’s a MyBB forum) and there’s a specific web page where I have written it 10+ times. To make code easier to read I decided to turn it into a function and call it with different arguments each time. Unfortunately it isn’t workin…