I currently developing a WiFi monitoring system. Can anyone guide me on how to block user access form certain website ie Facebook or Youtube by using php?
This is usually done within the configuration settings of your specific router and not with PHP. Consult the documentation for your particular router on how to block certain sites on your network, or look up Parental Controls.