IPhone Secret codes are available here, these codes will work on the iPhone 3 or 4, most of them are actually service codes which do not work in all countries and regions.
iPhone Secret Codes:
|*3001#12345#*||Enters Field mode which allows you to access most of the hidden settings and functions of your iPhone|
|*#06#||Display the IMEI of your iPhone, as always this is the standard code for all brands of phones.|
|*225#||Displays the account balance for postpaid contracts|
|*777#||Displays the account balance for prepaid accounts|
|*646#||Displays the remaining minutes available|
|*3282#||Get your data usage information|
|*729||Options to make payments|
|611||Dials customer service, (114 in RSA for Vodacom)|
There you have it, all the codes available for the iPhone. Much like Android there really are not that many interesting secret codes since the operating system can and does expose the bulk of the features already. If you have any other interesting iPhone secrets or hacks please e-mail them and I will add them here. Of course there are not going to many codes because Apple exposes most of the interesting data and settings already. The field mode functions are mostly exposed in phone settings and the IMEI is the only thing needed most of the time.
If you need your IMEI you will probably download an app in any event or figure out how to find it from the interface on newer OS versions.