Well , if you are developing something for jailbroken devices , yes it is possible to use php (you have to install it first from Cydia).Also note that you should implement a SQLite database if your app/script needs database functionallity . (you can't run a MYSQL server natively on iphone atm).
But, as pekka mentioned , this is a really bad idea , cause you must set up first a lighttpd web server on iphone (not really comfortable) , or if you 're planing to implement a CLI php script , you should first launch it (using some C funtions like pipe(),dup2(),fork() ,execl() ) and then parse its output inside your -not-so-Objective-C- iphone app.
So think it again...