These secret codes are for Samsung Galaxy S2. I have gather them through research on the internet. They are know to work with the official dialer, But it may or may not work with third party dialers. It may work on customized ROMs if the original dialer is used. Be careful when playing with the codes.
*#0*# - Takes you to LCD TEST MODE
*#9900# – Takes you to System Dump, where Disabling Fast Dormancy gives a boost to your network speed on some networks (both wifi and Gprs), same code to re-enable it.
*#1234# – Check your Firmware version.
*#06# – Imei Code
*#2263# – Network modes select
Credits to goangeek Blog