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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:26:31+00:00 2026-06-15T22:26:31+00:00

in general I think I understand what the error message means. But in my

  • 0

in general I think I understand what the error message means. But in my case, it’s a riddle I didn’t succeed in solving…

    $keywords_all = array();
    $count = 0;

    for ($z = 0; $z < $num_results; $z++)
    {
        $keywords_array = explode(",", $row['free_keywords']);

        for ($i = 0; $i < count($keywords_array); $i++)
        {
            if (in_array(strtolower(trim($keywords_array[$i])), $keywords_all))
            {
                $count++;
            }
            else
            {
                echo "<br />".$keywords_array[$i];
                $keywords_all[$count] = $keywords_array[$i];
            }
        }

        $row = pg_fetch_array($result);
    }

So, what’s wrong with that one? The error message pops up in the line

    $keywords_all[$count] = $keywords_array[$i];

I have no clue, seems to be alright to me. But guess, it’s again a tiny, tiny thing I’ve neglected… Thanks for any hints!

  • 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-15T22:26:33+00:00Added an answer on June 15, 2026 at 10:26 pm

    I was not able to reproduce your error message. I did find a bug in your code though (I am assuming that you are putting all your keywords in the $keywords_all array without any duplicates). So you should not increment $count inside your IF but instead update the $keywords_all count. See below:

    if (in_array(strtolower(trim($keywords_array[$i])), $keywords_all)) {
        $count = count($keywords_all);
    } else {
        echo "<br />".$keywords_array[$i];
        $keywords_all[$count] = $keywords_array[$i];
        $count++;
    }
    

    You will increment $count after storing a value to your $keywords_all array.

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

Sidebar

Related Questions

I think I got what a continuations is (in general), but I can't understand
This is a general question of sorts, but do you think that it's important
I can understand that WCF is in general better than Remoting, but the two
I think I understand how ASP.NET routing works, and in general how the IIS
OK I think I get Difference between jQuery.extend and jQuery.fn.extend? in that the general
EDIT: This question was initially too general, I think. So What I really need
General use case I am trying to implement a basic shell. Description I need
Brief googling looks like you're supposed to use MarkupBuilder, but I don't understand it.
This is just a general question. As I understand it an object factory is
I'm using the em-ws-client gem, although I think my question is more general than

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.