<?php $re = '/\|{\K\d+(?=})/m'; $str = '{1|{1078} {*|{1079}-}test{1|{4829}, test2 {4457}}} {*|{1078} {*|{1079}-}test3{1|{4829}, test4 {23232}}} '; preg_match_all($re, $str, $matches); rsort($matches[0]); echo implode(',', array_unique($matches[0]));
You have javascript disabled. You will not be able to edit any code.