Re: Using count() as an array index [message #178466 is a reply to message #178464] |
Tue, 19 June 2012 15:27 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 6/19/2012 11:03 AM, Martin Leese wrote:
> Jerry Stuckle wrote:
>> On 6/18/2012 10:46 AM, Martin Leese wrote:
>>> Jerry Stuckle wrote:
> ...
>>>> A better way is to hold the information in a database.
>>>
>>> No, I will not need to change my code. I
>>> am using an array as a replacement for a
>>> database. Here is a snippet of my file
>>> faqData.php to give you the idea:
>>>
>>> // Set data to identify Web page, and set prev and next anchors
>>> // Note that the first set must have index explicitly set to [1]
>>> $tempIndex = 1;
>>> $dataHref[$tempIndex] = "Ambisonic/faq_section01.html";
>>> $dataAnchorText[$tempIndex] = "1. Where can I get this FAQ?";
>>> $dataCompleteText[$tempIndex] = "1. <a href=\"#SECTION1\">Where can I
>>> get this FAQ?</a>";
>>> $dataSplitText[$tempIndex] = "1. <a rel=\"section\"
>>> href=\"$dataHref[$tempIndex]\">Where can I get this FAQ?</a>";
>>>
>>> $tempIndex++;
>>> $dataHref[$tempIndex] = "Ambisonic/faq_section02.html";
>>> $dataAnchorText[$tempIndex] = "2. Corrections to the FAQ";
>>> $dataCompleteText[$tempIndex] = "2. <a href=\"#SECTION2\">Corrections to
>>> the FAQ</a>";
>>> $dataSplitText[$tempIndex] = "2. <a rel=\"section\"
>>> href=\"$dataHref[$tempIndex]\">Corrections to the FAQ</a>";
>>
>> Yes, which means if you need to change your FAQs you need to change
>> this code.
>
> This code is my database. Yes, if I change
> the FAQ I will need to change the database.
>
This is not a database. It is a PHP script.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|