Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:28:18+00:00 2026-06-13T09:28:18+00:00

OK, this may sound like an odd question so first let me lay out

  • 0

OK, this may sound like an odd question so first let me lay out the basic situation:

At our company we’re using a ticketsystem. This system has a FAQ dbase. I can’t change the structure of the database in any way because we would have to change the ticketsystem to cope with that change and that is not an option.

So with that out of the way…
Because there is no seperate field available we add a chapter number to the title of every item to have a sort of index.

So you’d get something like this:

1 start
1.1 some subchapter
2 new chapter
3 another chapter
3.1 sub of chapter
3.1.1 sub sub chapter

etc..

Offcourse with a nifty regex it’s easy to extra the chapter part from the string. But the next step would be to make it easy to find the corresponding subchapters based on the parent chapter. Easiest way to make this searchable without a database would be a multidimensional array, right?

So you would get this:

array( 3 => array( 
              'item' => 'data', 1 => array('item', 2 = array() ) ) )  etc...

What I’ve done now is to create an array of chapter indexes ( [3,1,1] in the case of 3.1.1 ) and because I know the there are always between 1 and 3 items in this array I made a switch based on the array length and then did this:

$array[$index[0]][$index[1]]['item'] = $content;

But I feel this is a very dirty and unlfexible way of doing this. Normally I’d vote for changing the database structure no matter what, but without that option I’m unsure what the best method would be.

Any help would be great!

EDIT: Added my comment below for better readability

Titles are one line indeed, but that part I have working with a regex to extract the chapter part. So that’s working.

What I basicly build is a form that uses the array of indexes to build a list of checkboxes for each chapter or chapterpart. But I don’t want to search through the array and compare keys to find subchapters. So if I’d choose 3.1 I’d check 3.1.1, 3.1.2 and because the key starts with 3.1 I’d know to print it.

Faster would be to be able to do this:

Choose 3.1.1 => return $chapters[3][1][1][‘item’]

But that’s only possible when I can build the initial array in that form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:28:18+00:00Added an answer on June 13, 2026 at 9:28 am

    The situation has changed and we are creating a second database structure with a better setup to handle the situation above.

    Basicly we use that to both print a well formatted PDF as well as pushing the info in the FAQ of the ticket system.

    This gives us the best of both world and thus solving the issue above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand this may sound like an odd question.. I have a repo on
This may sound like a silly question but in D (using std.regex ) how
This may sound like a strange question, but hopefully there is an answer out
this may sound like a silly question but our IT department wants us to
This question may sound like for beginners, however when I found that out I
This may sound like a simple and trivial question, but I'm using the following
Realize this may sound like a broad question - so let me clarify. I
This may sound like an odd question, but when I go and open a
This may sound like a very generic question but here it goes. I have
This may sound like a stupid question but I can't seem to find an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.