We keep sows just behind a single strand of electric tape, growers behind two strands. This gives a flexible solution that lets you expand the area or move it easily and cheaply.
4 caveats though.
1. Pigs must be trained to it, easily done by having a training area - stock wire with electric round the inside. A week or so in there and the pigs learn about the electric.
2. If they do get out, they must be to somewhere safe - eg still within your ground, they will not run immediately to the next fence and break out, but will spend hours exploring what is in between. So if your ground has some sort of fencing that would stop a pig wandering out of your land, the once trained you can use electric to create an area within it for your pigs.
3. If you are heavy deer country then deer can take the electric away (hence rule 2), and don't do this in the middle of a badger set - you should site pigs away from badgers in any case as there is a TB risk.
4. Pigs can get out from this system, but very rarely do. However If they do, you must be prepared for their inquisitive consequences, so don't site your pigs next to your prize vegetable patch, or beautifully manicured lawn.
We like using electric tape (horse tape) as the pigs see it clearly and so avoid it.
If you can't do the above, then stock wire with electric on the inside (ala Robert) provides a secure solution. I don't like using barbed wire - risk of damage to pig. Plain stock fencing may work, but as the inside gets "used", and pigs get bigger it is likely that the pigs will simply lift the fence up and get out.
Pigs don't escape (as in feeling like they are in a prison), they merely wish to explore new opportunities for better rooting, so move an obstacle that is in their way.