If I buy an iphone from at&t can i use it as a phone under tmobile?

My friends told me that since at&t iphones also have sim card slots, i can just change the sim cards and i'm good to go.

Buying iphone from at&t means you are locked to at&t for 2 years. Just buy iphone under tmobile and you can use it with any sim

Not until you get the phone "unlocked".AT&T and T-Mobile are both gsm networks so the phone would work but only if it is "unlocked".

Make sure to call the company you're switching to. While on the line they'll tell you what you need to do.

Your friends forgot one detail. The phone would have to be unlocked in order for that to happen.

It is not that simple. If it is an AT&T phone, AT&T would have to unlock the phone for it to be able to be used on T-Mobile. Then you can put your T-Mobile SIM in it and use it.

AT&T will lock unlock it for free so long as the account is in good standing and not reported lost/stolen.