Binary search is a simple but tricky method of searching at phenomenal speed compared to standard sequential search.
However it has its quirks and here on this video I will show you how and when to use, and when not to use binary search in a program.
I made an implementation of Binary Search in PHP using spaceship operator and its source code will be available at the end of my video. So be sure to watch until the end, like the video and subscribe to the channel.
In addition to just sharing the source code, I've made some test run for the code with on an array filled with random number and to show how the code perform compared to sequential search, spoiler: binary search round blazingly fast compared to standard sequential search.
Video available in https://youtu.be/C33BTbe0qPY