Reading the other post thread, I think PHP isn't what you want. If you want to code web-based games, you should use Javascript and HTML5.
PHP is used (on a server side) to generate a "customized" webpage, using an engine, then send the "customized" webpage to the user. For example, blogs constantly generate "customized" pages: when you click on a tag, the engine will generate a page with all the posts (that might be in a database) and then send that page (containing only that information) to the user. That gives the illusion that the website is "dynamic".
Javascript, on the other hand, is a script language that will be executed in the client-side (in the user computer). It can be used to add, delete or modify the content that is already in that page in the client-side.