Hi Rebbu, you gave me very nice input...
in fact i just need to auto dynamically populate a SelectBox element on an HTML webpage with the files found in a certain directory for option value. The values are supposed to be split by dash, underscore and number to provide the option name, e.g.
Directory with Files > Value SelectBox Options
filename1.txt > value: filename1.txt, text: Filename 1
file_name2.txt > value: filename1.txt, text: File Name 2
file-name3.txt > value: filename1.txt, text: File Name 3
so i don't want to type file name from directory one by one (manual) anymore & avoid some mistyping (that's my goal) with config.php
$fn["short"] = "file-name.txt"; $fn["long"] = "file name";
$fn["short"] = "1_file-name.txt"; $fn["long"] = "1 file name";
Using this script:
echo "\$fn[$i]['short'] = '$file'; \$fn[$i]['long'] = '$file(splited)';<br />";
because i think it can handling to auto populate value of config.php, but i'm wrong because it's just echoing, that's why i make question here just to looking for another better way.
Your final question will require a basic string manipulation script (str_replace, or something similar)
this something stranger to me, can you explain it more please, that maybe can help me..
Many Thank you for your input.