Google Page Rank PHP indicator?

I want to know how to if possible, show google’s page rank for a certain page dynamically. I know with PHP you can display an image that says online, or offline depending on the sites status. I was wondering if this can be done with page rank.