You have two choices really to find out if ip is dedicated or shared.
1. Use google and find for a tool that does this, parse the results with PHP. Lots of tools will do this search.
2. Use msn.com, type into search: ip:IP_ADDRESS and parse the results with PHP. This is the direct way as most of the 1. option tools use this option anyways
If only one domain appears as a result you have a dedicated IP else its shared.
None of this two is of course 100% accurate but as far as i know this is the only way to do this.