2011-04-29 49 views

回答

2
$string = "http://yourdomain.com/index.php?main_page=product_info&products_id=5"; 
$pattern = "/products_id=(\d+)/"; 
preg_match($pattern, $string, $matches); 
$out = "Product Id = ".$matches[1];