PS3 joystick problem

Hi all,
I want to replace ps3 controller joystick with a digital pot and control it by arduino. The problem is that ps3 controller joystick has 4 pins instead of 3 so how I could wire it with arduino?
thanks

Have you got a meter out and measured the resistances between those 4 pins? First thing
to do, two of them might simply be commoned up.