我如何从 url 中检测电影标题..
http://www.mysite.com/2430-Moonrise-Kingdom.aspx
http://www.mysite.com/2405-Dark-Shadows.aspx
http://www.mysite.com/2415-Madagascar-3-Europes-Most-Wanted.aspx
我需要将utl从:
http://www.mysite.com/2405-Dark-Shadows.aspx
至:“暗影”或“暗影”
我的代码是:
$regexUrl = "/\/[0-9]{2,4}\-[a-zA-Z0-9\-\.]+\.aspx\/?";
echo preg_match($regexUrl, $_SERVER["REQUEST_URI"]);