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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:07:59+00:00 2026-05-26T05:07:59+00:00

I want to know the best way to do a PHP IF OR statement..

  • 0

I want to know the best way to do a PHP IF OR statement.. but I have a list of arrays over 30+

This is the current format of the array:

if($cq=="45" || $cq=="45" || $cq=="35")  {

// action to my function

}

I know I can do an array but Array(); does not support conditions..

Thanks

UPDATE – I know it is old, even I know that and I am novice PHP. Look at my profile questions example (blank ones)

This is the code I was left with:

if(
                            $cq=="45" || 
                            $cq=="53" || 
                            $cq=="37" || 
                            $cq=="70" || //
                            $cq=="74" || //
                            $cq=="36" || // - this function removes colours if they have this ID
                            $cq=="66" || //
                            $cq=="61" || //
                            $cq=="69" || 
                            $cq=="20" || 
                            $cq=="55" || 
                            $cq=="50")

                            {



                            }
  • 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-26T05:07:59+00:00Added an answer on May 26, 2026 at 5:07 am
    $yourArray = ('45', '45', '35'):
    if ( in_array($ca, $yourArray) ) { ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know what is the best way to benchmark my PHP scripts.
Bascially I want to know the best way to hide/show an ASP.NET control from
I am creating a windows service and want to know best practices for this.
i want to know the best way (faster and better) to structure the code
I have just started PHP and mySQL and need to know if this is
Does anyone know of the best way to render clean vectors into a php
In PHP, what is the best way to split a string into an array
I want to know what will be the best way for a char-char conversion.
I want to know what the best practice is for passing values (sometimes multiple
Basically, I want to know what is best to avoid future problems and confusions

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.