<?php $arr = array( 'news', 'news?test=1', 'news/list?test=1', ); $res = array(); preg_match('/(\w)+[\?\/]?/', $arr, $res); print_r($res);
You have javascript disabled. You will not be able to edit any code.