php - how can i remove strings in a file ? -


this code

foreach(glob("useri/*.txt") $filename) {  echo "<li><a href=$filename>$filename</a></li>" ; } 

the output :

useri/caca.txt useri/pipi.txt useri/pufu.txt useri/sadzxc.txt useri/zan.txt 

i want remove useri/

ty on every submit button .txt created.

simply remove first 6 characters of string substr.

try :

foreach (glob("useri/*.txt") $filename) { $file = substr($filename, 6);  echo "<li><a href=$filename>$file</a></li>" ; } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -