1. 程式人生 > >php擷取某個字串之前的資料

php擷取某個字串之前的資料

$strlen = strlen($sql);  //全部字元長度
$tp = strpos($sql,"LIMIT");  //limit之前的字元長度
$sql = substr($sql,-$strlen,$tp);  //從頭開始擷取到指字元位置。