我想能夠檢索查詢的最後兩個字符串。從這個意義上說,我有一個稱爲course_tax的項目,檢索爲1.05或1.10或1.11等,我想檢索05,10或11.檢索查詢的最後兩個字符串
這實際上是我現在如何檢索它:
$course_id = $_GET['crs_id'];
$get_crs = "select * from courses where course_id='$course_id'";
$run_crs = mysqli_query($con, $get_crs);
while($row_crs=mysqli_fetch_array($run_crs)){
$course_tax = $row_crs['course_tax'];
}
不知道關於MySQL的解決方案,但簡單的str_replace()函數可用於輸出,例如解決方案$稅= str_replace函數( '1', '',$ course_tax); – sinisake 2015-04-02 21:30:22