you can do alot more with php than flash unless you just want to no how to make pain games like on miniclip.com or you want to create other style of games like neopets.com so i think u should learn php first then learn flash then u would be one heck of a programmer.
An PHP rpg would not be like a traditional one where your character would be responsive immediately. Because PHP is server-side, it can only work when the code for a page is being processed.
An PHP rpg game would therefore result in a lot of **** and loading and so it will be very boring. I recommend using Flash and then interact with databases using PHP or just plainly keep a save file on the computer.