Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

scandir function expanded

Featured Replies

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 by kensha

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.

  • 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:)

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!

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 by webdesigner93

  • Author

Nice, I didn't even discoverd the function implode yet.

I believe I should thank you for that webdesigner

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

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.