Try:
<?php
$card = '9999888866661234';
print substr_replace( $card, '************', 0, 12 ) . "\n";
print '************' . substr( $card, 12, 4 ) . "\n";
?>
Both of these produce the output I believe you're looking for.
Of course, there are other ways you could do this....these are just 2 examples.
-Rich