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