天天看點

php提取字元串參數

$str = "article.php?cate_id=15&id=54";

$begin = stripos($str, "=")+1;

$ends = stripos($str, "&")-$begin;

echo substr($str,$begin,$ends);