2 回答

TA貢獻1804條經驗 獲得超2個贊
只需將輸出該按鈕的代碼包裝在一個if塊中,該塊檢查文件名的第一個字母是否為m:
<?php
if ($files[$a][0] == 'm') {
?>
<button class="btn btn-sm btn-primary"><a
href="upload_dms_file/delete_filing_storage.php?name=uploads_filing_file/<?php echo $files[$a]; ?>" style="color: white;">
Edit Meeting File
</a></button>
<?php
}
?>

TA貢獻1829條經驗 獲得超13個贊
您需要if在按鈕部分添加一個子句:
<button class="btn btn-sm btn-primary"><a
href="upload_dms_file/delete_filing_storage.php?name=uploads_filing_file/<?php echo $files[$a]; ?>" style="color: white;">
Edit Meeting File
</a></button>
應該
<?php if(strlen($files[$a]) > 1 and substr($files[$a], 0, 2) = "m-"){ ?>
<button class="btn btn-sm btn-primary"><a
href="upload_dms_file/delete_filing_storage.php?name=uploads_filing_file/<?php echo $files[$a]; ?>" style="color: white;">
Edit Meeting File
</a></button>
<?php } ?>
- 2 回答
- 0 關注
- 122 瀏覽
添加回答
舉報