PHP probably does not really have anything to do with this. Search engine ranking is dependent basically on two things: the number and quality of external links from other sites to yours, and the content of your pages. While PHP might be used as a means to generate some of your content, it's still up to you to determine what that content will be.
You might want to do a web search on "search engine optimization" (or "SEO"), and you'll certainly find lots of links on the subject. Just beware, there is a lot of out-of-date info, wrong information, and "snake oil salesmen" who'd love to sell you questionable SEO services.
You might want to poke around the Google webmaster support site, starting here.