'Detect if device has microphone/camera in PHP

I know this can be done in Javascript, I've seen it on projects like these: https://www.webrtc-experiment.com/DetectRTC/

I just need to detect if the device viewing my website has a microphone/camera and do an if statement on it, but in PHP.

How would this be possible?

php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source