First things first, PHP has enough functions built-in for people to make Browser based games, Multi-player or single player.
Using Client-Side languages like JavaScript can also give your game animations and such, so you're not limited to text-based games.
However, coding a game isn't as easy as one might think, for a beginner even harder. Games written with PHP require very good knowledge on related things, like HTML/CSS/MYSQL, besides that you'll also need knowledge on constructing a game, it's base idea...
For creative people this isn't a problem, but making it work in an application isn't a hobby thing, if you want to go into this direction later in your life, I would recommend you to first try out some game-engines.
RPG Maker XP/VX for example can show you how games are being constructed, with each game you create with it, you'll understand more what things you should keep in mind when Programming a game.
Once you have played enough with the Maker, you can start learning required languages, however, you're not limited to PHP, Ruby (on Rails) and Python are the best choices.
I'm not really sure, but I think Ruby would be the best option if you want graphics and animations in your game. Ruby is also used in RPG Maker XP/VX, so you can write your own "mods" for the game it self.
The learning period can take you from 6 moths to 2-3 years, it's up to you how much time you invest, the programming takes again time, so I wouldn't trying to code a game before I'm not really sure that I can handle it.
I'll be inactive for sometime so you could learn the make games with RPG Maker in this time, then when I'm back I can help you out more.
There are alot of Game makers, but imo RPG maker is the best... Watch some youtube videos, read tutorials and do alot of stuff to learn.
http://www.rpgmakervx.com/ is a community for RPG maker"s", there you can get help learning your way around RPG makers.
Good Luck, and don't give up soon, even when you create a game with the maker you have an nice feeling...