August 13, 201115 yr hey guys I got a small tutorial on how to get the files in a nice downwards order without the use of array. <?php //Creates the scanner and adjust as a list with all file: names //beneath each other. function scanner($value, $key) { echo "File: $value . <br>"; } //placed the scanner function inside a variable //warning; you can't scan out the variable to see //if it works. $scanner =(scandir("c:\wamp\www")); //With a small adjustment you can however convert the array //by use of array_walk and for some reason the $scanner variable is //being printed out. array_walk($scanner,"scanner"); ?> Edited August 13, 201115 yr by kensha
August 13, 201115 yr hey guys I got a small tutorial on how to get the files in a nice downwards order without the use of array. <?php //Creates the scanner and adjust as a list with all file: names //beneath each other. function scanner($value, $key) { echo "File: $value . <br>"; } //placed the scanner function inside a variable //warning; you can't scan out the variable to see //if it works. $scanner =(scandir("c:\wamp\www")); //With a small adjustment you can however convert the array //by use of array_walk and for some reason the $scanner variable is //being printed out. array_walk($scanner,"scanner"); ?> Well this is pointless, any idiot knows to visit php.net/scandir where it can be explained better.
August 13, 201115 yr Author Perhaps but that is packed in an array. With this you remove the array and the key numbers so you get a nice cleaner list:)
August 13, 201115 yr Perhaps but that is packed in an array. With this you remove the array and the key numbers so you get a nice cleaner list:) LOL it kinda defines the point of having DOCUMENTATION located at PHP.NET!
August 13, 201115 yr hey guys I got a small tutorial on how to get the files in a nice downwards order without the use of array. <?php //Creates the scanner and adjust as a list with all file: names //beneath each other. function scanner($value, $key) { echo "File: $value . <br>"; } //placed the scanner function inside a variable //warning; you can't scan out the variable to see //if it works. $scanner =(scandir("c:\wamp\www")); //With a small adjustment you can however convert the array //by use of array_walk and for some reason the $scanner variable is //being printed out. array_walk($scanner,"scanner"); ?> I agree with shaun on this one, this is not much of a tutorial and none the less this is the wrong section theres a tut section on this forum, and down to the meat and gravy im confused as to what this function is for scanner when u can do this <?php $scanner = scandir("c:\wamp\www"); $scanner = 'File:'.implode("<br />",$scanner); echo $scanner; ?> Edited August 13, 201115 yr by webdesigner93
August 13, 201115 yr Author Nice, I didn't even discoverd the function implode yet. I believe I should thank you for that webdesigner
August 13, 201115 yr Nice, I didn't even discoverd the function implode yet. I believe I should thank you for that webdesigner Np, just when u think on writing a tut do it on something that would be very useful to someone, and displaying files from a directory is kinda not that useful anymore not to me at least, but who knows maybe to someone else
August 13, 201115 yr Author I`m currently trying to create a small system where user can upload images, rename them, replace in a different directory etc. Kinda like a website builder for easy use. Seeing as I`m quite still a noob on this I still need to do a lot of recearsh to get it all correctly and it will be mine very own first system ever to be proud of. Maby later to expand on it.
Create an account or sign in to comment