I am not familiar with PHP, but I believe you could use the decbin function to get a string representation of the given decimal number in binary. After this, you would simply need to check whether the Nth bit equals 1.
There are probably much better approaches, but this should do the job.
Edit: base_convert(string $number, int $frombase, int $tobase) may also be of interest.
We've deprecated the forum. It is still available at the bottom of the site, but we are moving away from Q&A since StackOverflow has that covered so well.