Try this guy: http://www.fourmilab.ch/webtools/PageRank/
although written in perl, you can issue a call to your OS from PHP to run this, then further process the output. Make sure to put http:// at the beginning your your query, and not hit the google server more often than once per second, and sanitize (urlencode) the user input if users will be using this.