Im using a simple script to colled the names of the files in a folder, and printing them as i wish.
However, how can i remove the .txt out of $file
Ive had a search of this place, and found nothing useful.
<? $file = "file.txt"; print substr($file, 0, strrpos($file, '.')); ?>
Diego
Thats worked fine, thanks for your help!
actually, PHP does have a built-in function for this:
<? $file = 'file.txt'; $file = basename ($file, '.txt'); echo $file; ?>
outputs "file"
Yeah, but I think the OP wants to remove any extension, not just .txt...