| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #2 (permalink) |
| If only you knew... Join Date: Oct 2005 Location: Inside your head...
Posts: 998
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Let us say the current file name this script-bit is in is actually your test.php. <? $this = $PHP_SELF; $showthis = basename($this); $stripthis = basename($this, ".php"); echo $showthis."<br>".$stripthis; ?> produces: test.php test refer to: http://us2.php.net/manual/en/function.basename.php for more tools on using basename() with variables, ect.
__________________ --- The greatest truths ever told, and the greatest lies ever told, all consist of exactly the same three words: "I LOVE YOU" --- The best say little, only say what is important.....then they shut up and sit down.
Last edited by maximum; 07-09-2006 at 03:51 PM.
|
| |
| | #3 (permalink) |
| Senior Member Join Date: Aug 2004 Location: Washington
Posts: 4,327
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | <? $mystring="file.php"; $filename=explode(".",$mystring); echo $filename[0]; ?>
__________________ Download youtube videos at www.HugYouTube.com -NO LINKS TO PARKED PAGES- Anonymous access at www.Banned.net |
| |