I doubt theres a function for that. Such information updates daily and one would need access to the database that keeps track of it.
Look around and see if anyone offers a database you can import to mysql. Then use PHP to find out.
Oh and find a way to keep that database updated 🙂
p.s - You might be able to form a query string and query dnsstuff.org or whatever and use the returned value for your purpose too?