Here is an example of what I am trying to do:
index.php
<ul><?php include("list.php") ?></ul>
list.php
<?php
if (PAGE_NAME is index.php) {
//Do something
}
else {
//Do something
}
?>
How can I get the name of the file that is including the list.php script (PAGE_NAME)? I have tried basename(__FILE__)
, but that gives me list.php
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…