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

  • Home
  • SEARCH
  • 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 3602024
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:41:39+00:00 2026-05-18T20:41:39+00:00

Hey there. I am writing some PHP that needs to check to see if

  • 0

Hey there. I am writing some PHP that needs to check to see if a inputted value fits in with a whole bunch of options. What’s the best way to hold all options to check against? I know that an array would work, but is there anything more efficent for this type of operation?

  • 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-05-18T20:41:39+00:00Added an answer on May 18, 2026 at 8:41 pm

    Checking if the input is a member of an array is actually a pretty safe and efficient way of securing it. For more complex checks, you may want to consider regular expressions with preg_match. However, regular expressions can easily become complicated. Also, one word of advice: Until you’ve modified the php interpreter, do not worry about of the efficiency of php commands except for loops and network code.

    In many cases, you can actually accept anything and then encode it.

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

Sidebar

Related Questions

Hey there. I am writing some PHP that needs to check to see if
hey there, i have a div that expands when the page is loaded, now
Hey there. I'm trying to write a small program that will read the four
Hey there, I'm writing a template container class and for the past few hours
Hey I thought about writing a function that prompts me in certain situations (perl
Hey I am writing a function that handles favorites within my app, as well
Hey guys, Im working with wpf 3d, im currently writing a program that will
I'm writing a JUnit test that check messages (one message per line) inside one
Hey. I have some problems writing char to a file with ofstream. this is
Hey all, I'm writing an app to handle registration for athletic events. Some of

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.