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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:40:51+00:00 2026-05-29T04:40:51+00:00

The table below displays all words in the string $commentstring . How can I

  • 0

The table below displays all words in the string $commentstring. How can I exclude certain articles, prepositions, and verbs like “the, of, is”?

$words = explode(" ", $commentstring);

$result = array();
arsort($words);

foreach($words as $word) {    
  if(!is_numeric($word)){
    $result[$word]++;
    arsort($result);
  }
}

echo "<table>";

foreach($result as $word => $count1) {
  echo '<tr>';  
  echo '<td>';
  echo "$word";
  echo '</td>';

  echo '<td>';
  echo "$count1 ";
  echo '</td>';

  echo '</tr>';
}

echo "</table>";
  • 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-29T04:40:53+00:00Added an answer on May 29, 2026 at 4:40 am

    Several ways to do this, if you still want to count them but just not display them in the table, you could do:

    $blacklist = array('the', 'is', 'a');
    
    foreach($result as $word => $count1)
    {
        if (in_array($word, $blacklist)) continue;
    
        ...
    

    if you don’t even want to count them, you can skip them in a similar way in your counting loop.

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

Sidebar

Related Questions

In the table below, the entire cells are hyperlinks. How can I make just
I have a table like below: EmployeeId EmployeeName RequestId RequestName EmployeeId RequestId I need
Take a simple table like below: Column Headings: || Agent's Name || Time Logged
Can anyone suggest an easy fix for the query below? Workout.all(:joins => [:person, :schedule],
The table below works well. However, I am trying to pass $row[username] along as
Would following the table below be the best way of determining the access type
i have the table below <tr id=group_1>...</tr> <tr id=el>...</tr> <tr id=el>...<tr> <tr id=group_2></tr> <tr
How would I create a nested grouping for the table below, using LINQ? I
I have a table as below Name Priority Date ------------------------- A 2 d1 B
I have a table as below dbo.UserLogs ------------------------------------- Id | UserId |Date | Name|

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.