I have that string : $text=70ac0f2e7247e9a658f71fe6362bf53
I want to replace all consecutive numbers by only the first number. For example I want to replace 70 by 7, 7247 by 7, 658 by 6 and so on.
I have this pattern : $pattern = '/[0-9]{2,}/';
but I don't know how I could build the $replacement
and the preg_replace to make :
preg_replace ($pattern2,$replacement,$text3);
Thank you !