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 9237369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:31:14+00:00 2026-06-18T07:31:14+00:00

I am developing a FAQ (Frequently Asked Question) PHP script and I want to

  • 0

I am developing a FAQ (Frequently Asked Question) PHP script and I want to implement a way for users to search the FAQs. This is a small script so I have the categories and FAQs in an array as shown below:

$qa = array();
$qa['Getting Started'] = array(array('What is 1+1?', '2'), array('What is the square root of 16?', 'The square root is 4'));
$qa['Installation'] = array(array('What is 2+2?', '4'), array('What is the square root of 64?', 'The square root is 8')); 

Now, what I want to do is take a search query from a form (using a GET request) and search this array for that search query. I was wondering how I might go about doing this? Would I have to parse the search query first so that the array can be searched? Would I be able to use the array_search() function for this or would I have to write my own code to iterate through the array? I was also wondering if the FAQs are better to be stored using a different method (XML, SQL, etc) to do this?

  • 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-18T07:31:15+00:00Added an answer on June 18, 2026 at 7:31 am

    I would use a database for the questions something like:

    id int not null auto increment primary_key,
    question text not null,
    answer text not null
    

    Then I would do a where like query:

    ...
    WHERE question LIKE '%questionsearchvalue%'
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing application with friend, but ran into a question... I had this code :
Sorry if this is not the type of question to be asked here but
Developing for Android 2.3, I have a question regarding layouts. I use a vertival
Developing a new ROR3 website, I need to implement a sort of internal mail
Developing for android I need a translate animation. That was easy, but I want
Developing an application for Android, i want to record data that will be usefull
Developing is more of a hobby at the moment; so apologies if this is
Developing mobile apps is a challenging job. Customers want to be present not only
Developing a web app which should enable users to organize the events on their
Developing iPhone Application with Entertainment domain and what to implement that when user download

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.