IPhones use two cable types as of 2015: the 30-pin dock connector and the 8-pin Lightning cable. The 30-pin cable is designed for the iPhone 4S and older models, while the Lightning cable is compatible with the iPhone 5 and newer, up to and including the iPhone 6S Plus.
Although the 30-pin dock connector and 8-pin Lightning cables are proprietary Apple designs, it is not necessary to buy official Apple cables. Third party manufacturers often sell iPhone-compatible cables at lower prices. However, the cheapest iPhone cables can be unreliable, so it is usually best to purchase cables that have been officially certified by Apple, according to CNET.