Ok, so looking at this code:
$accountMask = substr($transaction['cc_number'], strlen($transaction['cc_number'])-4);
I think it takes a number like this: 1234567890
And turns it into this: 123456
Am I crazy to think that the code is actually doing this: 7890 ??
In my opinion, if I wanted to show just the last 4 digits of a number like a CC number, I would do this:
$accountMask = substr($transaction['cc_number'], -4);
Right?
Both of your examples do the same thing. As per the comments check out the documentation on substr()
Particularly the second parameter: