Welcome Guest, Not a member yet? Register   Sign In
'Filer' Helper help.
#1

[eluser]visua[/eluser]
Hey guys, I am trying to get a list of files and folders using the file helper.

Here is my app 'structure'

controllers/
/admin
dashboard.php
/blog
post.php
config.php
/pages
page.php
manage.php

I want to return this in an array format, so I can dynamically build my admin menu.

I tried;

$menu = get_dir_file_info('./admin');

and echoing that out just echos the word 'Array'.

Any help? Thanks.
#2

[eluser]Yorick Peterse[/eluser]
[quote author="visua" date="1248403509"]Hey guys, I am trying to get a list of files and folders using the file helper.

Here is my app 'structure'

controllers/
/admin
dashboard.php
/blog
post.php
config.php
/pages
page.php
manage.php

I want to return this in an array format, so I can dynamically build my admin menu.

I tried;

$menu = get_dir_file_info('./admin');

and echoing that out just echos the word 'Array'.

Any help? Thanks.[/quote]

That's because you can't just echo the contents of an array. If you want to view the array contents use the following piece of code :

Code:
print_r($menu); // Prints the array structure.




Theme © iAndrew 2016 - Forum software by © MyBB