$str = "functional-sophisticated-m66563-p-723.html";
$str = preg_replace("/-p-*\.html/", "", $str); explode() - 使用一个字符串分割另一个字符串
$str = "functional-sophisticated-m66563-p-723.html";
test($str);
$str = "fdalfkdsaj-afidafodau-m123424-p-723.html";
test($str);
function test($str) {
$str = preg_match("/(.*)(-p-*\.html)/", $str, $match);
print_r($match);echo '<br />';
print_r($match);echo '<br />';
}
页:
[1]