To connect iPhone 6, iPhone 6 Plus, iPhone 5, iPhone 5c, or iPhone 5s with your TV you need Apple Lightning Digital AV Adapter. One side can be plugged in to you phone while other side has one female charging port and one HDMI female socket. After plugging male side of the adapter plug in charger in charging port and connect HDMI cable to connect HDMI socket of the adapter and your TV.
For old android phones like Samsung Note 4 or Samsung Edge an MHL cable can be used to connect your phone to TV.
There are 3 types of MHL cables Standard micro-USB-to-HDMI Adapter which has common micro USB connector with 5 pins. Micro USB connectors on some Samsung devices have 11 pins, with such devices a Samsung micro-USB-to-HDMI Adapter can be used to connect a phone to TV. There are passive MHL cables too which do not provide any power source to the device, such cables can be used between MHL-enabled devices and an MHL-enabled displays only.