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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:21:52+00:00 2026-06-08T23:21:52+00:00

In PHP, one can use the following function to determine if one list (the

  • 0

In PHP, one can use the following function to determine if one list (the child) is a subset of another (the parent):

function issubset($child, $parent)
{
        $c = count($child);
        $valid = 1;
        for($i=0;$i<$c;$i++) {
            if(!in_array($child[$i], $parent)) {
                $valid = 0;
                return $valid;
            }
        }
    return $valid;
}

A similar but opposite concept is the idea of two lists being disjoint, whereby they have no elements in common whatsoever.

For example, the lists 1,2,3,4 and 4,5,6,7 are not disjoint because they have the common element 4, but the lists 1,2,3 and 4,5,6 are disjoint as they have no elements in common.

How might a function to check disjointness be designed?

  • 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-08T23:21:54+00:00Added an answer on June 8, 2026 at 11:21 pm

    if (count(array_intersect($a, $b)) == 0) { /* do something */ }

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

Sidebar

Related Questions

I'm passing information from one page another with following php code.. Index.php page: <?php
I'm not sure which php function to use for this.. How can I check
In R, one can use the following command for plotting regression line: res=lm(height~age) abline(res)
In PHP, one can do foreach($array as $key=>$value){//codes . Is it possible to create
How can I post a php variable from one file to an other? I
How to install the oauth in php. Can any one provide me the full
The following question can either be solved by probably changing my use of the
Please take a look at the following autocomplete code. $(document).ready(function(){ $(#the_input).autocomplete(/autocomplete.php, { //some options
In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth
I have a problem with PHP filemtime function. In my webapp I use Smarty

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.