<?php $strings = ['foo_1234', 'bar_3456', 'foo_5678', 'bar_7890']; $strings = array_map(function($string){ return preg_replace('/[a-z]+_(\d+)/i', '${1}', $string); }, $strings); var_dump($strings);
You have javascript disabled. You will not be able to edit any code.