Esp8266 and phone distance measuring


can we measure distance between phone and esp8266 connected to it if yes please send code for same



It is possible to measure range between devices using wifi, but it requires a more complex setup. These systems use triangulation and some more complex algorithms to do so.
Happily we live in the age of BLE (bluetooth low-energy) which has this capability using RSSI and ibeacon technology.
Search for this online you will find many references on how to do it.