When I sell my iphone is it still locked to a network?

Basically I have an iphone 4s and want to sell it it so I can upgrade but I want to keep the same phone number. I'm with 3 network at the mo so do I just say that's the network I'm with or will I have to get it 'unlocked' to sell it on?
also how do I wipe all my personal stuff off it like iTunes etc?

You selling your phone, not a number, so you 'll keep your number. Before you cell it you 'll need to deactivate your old phone and reset to factory settings, so there will be no personal info on it. When you advertise it you 'll advertise it with a network that phone on
Best of luck.