Jump to content

Get out of array


manalnor

Recommended Posts

Hello dear friends,

 

I'm using scandir function to get all directories but it gives results in array and i don't want it in array so how can i get out of this array.

 

<?php
$dir    = '/tmp'; // my directory
$files = scandir($dir);
print_r($files);
?>

 

The output is an array

 

Array
(
    [0] => iono
    [1] => toto
    [2] => soso
    [3] => fofo
    [4] => dod
)

 

But i want to get the directories names without being set in an array

so i want the output but

 

iono - toto - soso - fofo - dodo ....etc , I mean in any way but not in array  :shrug:

 

Thanks a lot for help

Link to comment
https://forums.phpfreaks.com/topic/259295-get-out-of-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.