file_exists(dirname(__FILE__) .'/.htaccess') ?'.htaccess':'.'
file_exists คือ PHP file_exists() Checks Exists files เป็น Function ใช้ในการสอบว่ามีไฟล์อยู่จริงหรือไม่
https://www.thaicreate.com/php/php-file_exists-check-exists-files.html
dirname(__FILE__) คือ โฟรเดอร์ ปัจจุบัน
/.htaccess คือ ชื่อไฟล์
ผมสงสัยตรงนี้คือ หมายควา่มว่ายังไง ? ‘.htaccess’ : ‘.’
มันเป็นการเขียน if() แบบสั้นครับ ถ้าเขียนแบบปกติจะได้แบบนี้
จาก
1.file_exists(dirname(__FILE__) . '/.htaccess') ? '.htaccess' : '.'เป็น
if(file_exists(dirname(__FILE__) . '/.htaccess')){'.htaccess' ;} else {'.';}