[eluser]coolfactor[/eluser]
I've managed to separate the two parts of the number. Here's my progress so far:
Code:
$cc = '1234-4344-2994-4394';
$pattern = '/^([0-9-]+)([0-9]{4})$/';
$matches = array();
preg_match($pattern, $cc, $matches);
The result is:
Code:
array(3)
{
[0]=> string(19) "1234-4344-2994-4394"
[1]=> string(15) "1234-4344-2994-"
[2]=> string(4) "4394"
}
Now, how do I use preg_replace() instead to mask element [1]?