Dynamic Array using glob?


Posted on 16th Feb 2014 07:03 pm by admin

Is there an easier way to do this?

I am trying to get create a dyamic array based on files within the folder.

Did you know?Explore Trending and Topic pages for more stories like this.
Code: foreach (glob("*.jpg") as $filename) {
$items = array("title" => $filename)
}

$output = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$output .= '<rss version="2.0">';
$output .= "<channel>";
$output .= "<title>" . $channel["title"] . "</title>";
$output .= "<description>" . $channel["description"] . "</description>";
$output .= "<link>" . $channel["link"] . "</link>";
$output .= "<copyright>" . $channel["copyright"] . "</copyright>";

foreach ($items as $item) {
$output .= "<item>";
$output .= "<title>" . $item["title"] . "</title>";
$output .= "</item>";
}
$output .= "</channel>";
$output .= "</rss>";

header("Content-Type: application/rss+xml; charset=ISO-8859-1");
echo $output;
?>
No comments posted yet

Your Answer:

Login to answer
216 Like 32 Dislike
Previous forums Next forums
Other forums

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library

UDP server recvfrom() always returns -1? :(
Hello all,
I am getting a very strange error in my code :( I am writing a server application in C

Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

Can you help please? Php file
I have to write this php file to allow users to register their nicknames on nickserv

For an I

background color imagefill
Hello

I would like to ask you why I see this square in red color just in my local xampp insta

help retrieiving results and doing pagination
Having some trouble trying to get the results to show on more than just one page.

What is ha

empty() error
Why does

Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash