views:

442

answers:

6

Hello All,

A friend of mine told me that it is possible to even create games with PHP.

Is that really possible?

Can we implement artificial intelligence using PHP?

Looking for your ideas.

Thanks

+14  A: 

Yes, PHP is Turing complete, so in theory you can create any kind of application you desire. It doesn't mean you should, though, and there are far more suitable tools out there.

DanDan
+1 for note on Turing complete.
mizipzor
+7  A: 

While it is possible to implement Artificial Intelligence and Games in PHP it's not optimal to do so. PHP's main design is targeted at effective Server Side web programming and as such isn't the most optimal platform to be developing Artificial Intelligence and Games on.

That said, it also depends on how you define AI, if you mean games that have AI again, it's possible but not optimal.

Programming languages are a way to express a concept, different languages are better at expressing different types of concepts. For PHP it's very good at expressing online server side scripting concepts, however it is less suited to expressing concepts like Video Games compared to more general languages such as C, C++, Java, C#, etc... (There are far more, this is just a shortlist)

If you really want online games you should consider Java which has excellent web integration while providing a better medium for creating games.

VoDurden
+4  A: 

I think php is good for creating browser games because php is meant to run at a server and generating output pages (xml, html, etc.)
If you like to create something else then a game where the logic runs on a webserver it would be more clever and more easy to chose a language that was designed to such things.

Hippo
Surprised no-one else thought of this: what about a myriad of web-based games? www.urbandead.com
Robert Grant
That's a good point, the original question needs to elaborate on what type of games.
VoDurden
I think my answer is as concrete as the question... :-)
Hippo
+2  A: 

Vanthia

PHPRPG/Ph'@ntasy/Ph'@ntom

Legend of the Green Dragon

These are just a few of the PHP games out there. Oh, and I made a project called Magbor (a little in-browser multiplayer game) which is heavy on PHP and JavaScript. So yes, you can see that it is possible.

Ricket
+1  A: 

http://code.google.com/apis/o3d/

LogIN