Hi.
I am kinda a newbie with PHP, and trying to learn new things as I go along. I have designed a site with PHP, and need some help from you guys.
Here's the situation:
I have a news section on my site for our club. When a user clicks on the link to the news (index.php?goto=news), he sees the headlines. I show the headlines by including headlines.txt at index.php?goto=news. headlines.txt file contains the headlines in an array, ie.
$headlines[0] = "Headline 1";
$headlines[1] = "Headline 2";
etc.
When a user clicks on a headline from index.php?goto=news, it'll take him to index.php?goto=news&id=1 (for instance), which includes 1.txt containing detailed information related to the headline. Now, I start off the details with the headline itself like this:
<b>$headlines[0]</b><br>
<p>This is the details about my first headline</p>
At the bottom of the page, again I include headlines.txt with a choice of showing last 5, 10, 15, etc headlines... the script is inside headlines.txt to accomplish this task. Everything works fine so far... but I need help with the following:
On the headlines page (index.php?goto=news), I want to show the headlines in the following format:
Headline 1 [added: 02/28/02]
Headline 2 [added: 03/02/02]
etc. However, I don't want the [added: Date] linked, so I can't use it inside $headlines array. Another reason I can't use it is because I use the $headlines[$id] as the heading of the detailed information about a headline, and I don't want it linked + don't want to show the date at the end.
I was wondering if a 2D array would help by storing the headlines something like this:
$headlines[1][$dateAdded]
but I am not exactly sure how to use it.
Please help me if you can. If you can think of any alternatives, I'm willing to try it out... just remember, I am still learning PHP 🙂
If I totally lost you, please email me so I can explain it to you once again what exactly I want to do.
Thanks in advance.
Mehul