Bitcoin Transaction Detection With PHP I Hope this isn't a duplicated, however I couldn't find anything about this anywhere.
Anyways, I am searching for a way of detecting Bitcoin transactions to a given address. I stumbled across Lazy API, however I couldn't find anything about carrying out what it listed, and I am still not sure how to go about detecting transactions to a given address. I went ahead and went to the given link it provided here (and I stumbled across doing using Transaction By Address from the API reference on blockexplorer, but I am still not clear how to go about detecting if I received a transaction.

Please pardon if this is a stupid question, I am a little new to all of this.
Edit:
I dont wish to relay on another service, unless it is the way Lazy API does it. (Basically complete minimals, from other services.)
 Also someone asked to clarify what I meant by detect a transaction, what I mean is have server recognize when someone completed a transaction, either notifying me to do something (such as ship a package), or giving them some sort of virtual product.
Im guessing your on ubuntu because of your username ;)
Step 1 add the bitcoin ppa


sudo apt-add-repository ppa:bitcoin/bitcoin


Step 2 install bitcoind


sudo apt install bitcoind


Step 3 set bitcoind up


Make a config file with the following contents in /home/$USER/.bitcoin/bitcoin.conf
https://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf
Replace some parts like rpc password etc


Step 4 add walletnotify


Walletnotify will run a shell command everytime something changes in your wallet.
I like this repo.
https://github.com/damonp/walletnotify


I hope this  helps!  :)