@Dan
I am not sure if I can write whole procedure here as well as if you are able to complete it into working solution by yourself.
Solution to this is:
- hide last 4 digits (i.e. substr($phone, 0, strlen($phone)-4) . 'xxxx')
- store number somewhere, i.e. under rel attribute of link (<a href="#" rel="<?php echo $phone; ?>")
- show phone on click via jquery ( $('a.phone').click(function() { $(this).text($(this).attr('rel')); } )