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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:49:19+00:00 2026-06-15T07:49:19+00:00

I am trying to find the results for a huge array (7000+ items) and

  • 0

I am trying to find the results for a huge array (7000+ items) and for some reason, the script I used before for another project keeps returning false, or I’m probably forgetting something.

I am trying to sort through an array and find two items that’s listed in a variable. Here’s the code:

$.getJSON('proxy.php?url=http://api.bukget.org/api/plugins', function(data){
        var list = ['essentials', 'worldguard'];
        //console.log(data);
        $.each(data, function(i, plugin){
            if (plugin === list) {
                console.log('found!');
                 } else {
                    return false;
                }
        });

    });

What am I missing from my code?

Using A Proxy:

<?php

    if (!isset($_GET['url'])) die();
    $url =  urldecode($_GET['url']);
    $url = 'http://' . str_replace('http://', '', $url); // Avoid accessing the file system
    echo file_get_contents($url);
?>

Which makes the data (snippet):

["a5h73y", "ab-marriage", "abacus", "abag", "abandonedcarts", "abilitytrader", "abitofrealism", "aboot", "absorbchests", "acc", "acceptdarules", "acceptrules", "accesscontrol", "accessories", "accident-tnt", "accountlock", "achat", "achievement", "achievements", "acientcave", "acommands", "actionzones", "activator", "activityhistory", "activitypromotion", "activitytracker"]
  • 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-15T07:49:20+00:00Added an answer on June 15, 2026 at 7:49 am

    return false will break out of the $.each if plugin !== list in the first iteration.

    Edit: If you want to find for any of items inside list and stop matching it’d be:

    $.getJSON('proxy.php?url=http://api.bukget.org/api/plugins', function(data) {
        var list = ['essentials', 'worldguard'],
            found;
        $.each(data, function(i, plugin) {
            if (~$.inArray(plugin, list)) {
                found = true;
                return false;
            }
        });
        if (found) {
            console.log('found!');
        } else {
            console.log('not found!');
        }
    });
    

    Fiddle

    If you want to find both of them:

    $.getJSON('proxy.php?url=http://api.bukget.org/api/plugins', function(data) {
        var list = ['essentials', 'worldguard'],
            found = 0;
        $.each(data, function(i, plugin) {
            if (~$.inArray(plugin, list)) {
                found++;
            }
        });
        if (found === list.length) {
            console.log('found all of them!');
        } else {
            console.log(found + ' items found.');
        }
    });
    

    Fiddle

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

Sidebar

Related Questions

Trying to find some information on this but am unable to get any results
Im trying to find a set of results in a database based on dates.
I'm trying to find out how I can iterate over the final results of
I'm trying to find some records based on the tags they have. In order
I am trying to find all results from my product table that id 's
I'm trying to write simple bash script and I'm stuck with find command. When
I'm trying to find a way of filtering results in a XML file as
I trying to query a database to find relevant results between two columns in
I'm trying to find a way to create a calculation from results in a
I am trying to find the syntax for inserting the results from an UNPIVOT

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.