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.

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

blank page.... nothing is happening.
I'm new to a lot of this but in the last 24hrs have learned a lot.
Installed latest version of my

Auto-populating dropdowns and multiple forms.
Here's what I have so far:

First drop down = select a state (works)
This populates the sec

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the

convert static html data into dynamic
hi all

i need to convert a website which has static above 2000 articles into dynamic and add

Hits this week counter
I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

Any meaningful project for a new C++ programmer?
I want to do some meaningful program, so I can help myself to learn

Assume I know the fol

Help on query replacing the date
Hi Pals,

i want to replace the current date in a column to some value say C or D or any n

Batch update record with Pagination
Hoping someone can help me with this issue I'm having, im trying to batch update records from a resu

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