Skip to main content
Inspiring
February 25, 2010
Answered

echo filename of ssi files

  • February 25, 2010
  • 1 reply
  • 1163 views

I have a PHP that has within it a series of server side include PHP files.

In each of these files I would like to echo the filename (less .php).

I have tried using:

<?php echo basename($_SERVER['PHP_SELF']) ; ?>

But this only displays the name of the file ENCLOSING all of the Server Side include files.

Is there another simple script I can use?

Thanks

This topic has been closed for replies.
Correct answer David_Powers

<?php echo basename(__FILE__, '.php'); ?>

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
February 27, 2010

<?php echo basename(__FILE__, '.php'); ?>

Inspiring
February 27, 2010

BRILLIANT !

WORKS A TREAT THANK YOU!

C