Set two variables to 0 before the foreach loop.
$positive = 0;
$negative = 0;
Then in your if statement:
if($entry[1] < 7){
//increment variable
$negative++;
echo $entry[1] . ' = Negative Feedback<hr>';
}elseif($entry[1] > 8){
//increment variable
$positive++
echo $entry[1] . ' = Positive Feedback<hr>'; }else{ echo $entry[1] . ' = Neutral Feedback<hr>'; }
Use the results as need.
Related Posts:
- How can I make a PHP counter?
- PHP 7.2 – Warning: count(): Parameter must be an array or an object that implements Countable
- C++ – how to find the length of an integer
- Count how many files in directory PHP
- select count(*) from table of mysql in php
- Counting the posts of a loop (WP_Query)?
- Category and children post count
- Hide the post count behind Post Views (Remove All, Published and Trashed) in Custom Post Type
- How to display 2 equal columns of li based on the count of items in wp_nav_menu divided by 2?
- Display user’s total comment count outside The Loop
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- Show weekly posts statistic in WordPress
- Increasing post view count automatically [duplicate]
- Count number of posts by author in a category
- Specific Loop For 2 Within Each
- How to change post count in wordpress loop?
- How we count the user draft posts
- Count total number of post in foreach loop
- Count number of published posts by type
- Displaying Gravity Form data on WordPress page [closed]
- How to count custom post types with conditional operators
- GravityForm: Populate Dropdown with custom post type [closed]
- What is the best way to count and display the number of posts?
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- Adding country tags automatically
- How do I dynamically populate a shortcode with a variable from URL?
- How to make sure content doesn’t display if selection is empty
- User’s total comment count excluding comments on their own posts
- Capture User Email Address When Filling Out Form
- Adding a new field to the address field type in gravity forms
- Get count of terms with a post and another taxonomy term?
- Function to capture a value and store it in a variable
- Keyword checking in Gravity Forms
- Gravity form built in Captcha
- How do I limit the number of forms a user can create in gravity forms?
- Counting posts in custom post type by author
- Show ellipsis (…) only if the number of characters exceeds limit defined in substr
- How to show the number of website visitors in my theme
- Using data sent via AJAX in multiple functions on a WP plugin
- Logic on a Gravity Forms redirect [closed]
- Get total views of all posts by author
- Count post + add number =
- How to do simple addition to increase favorites count of my wordpress posts
- How can i count the post added in relationship field, theme display
- Count posts published in one particular day: the lighter way
- In WordPress, how do I get the number of posts next to single_cat_title(”); in the category.php file?
- How can I count ACF sub_field with a certain value
- What is the best way to do this? [closed]
- Search Count WordPress Theme
- PHP -> SQL Query with Summing
- How to read out the excerpt length (for if-condition)
- Gravity Forms merge tags in templates?
- Taxonomy term count
- $count_posts->draft & published
- Counting number of posts in multiple (sub)categories using shortcode
- using shortcodes inside gravity forms
- Dynamically populate parameter in Gravity Forms using PHP
- Remove an action created by a Gravity Forms add-on
- Like and Dislike Buttons on Post with Counter – Only allow one click per post per user session
- Updating user meta adds string count to value?
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- Trouble Accessing Gravity Forms API (GFAPI)
- Confuse between forms and tables
- Warning: count(): syntax problem of the count () function
- How to get current post id in gform_field_validation gravity forms
- Reverse count page view and show on other page
- add ‘publish metabox’ to Gravity forms edit page/form area
- Run htmlentities() on all submitted values through gravity forms
- Configuring default woo commerce login with modal popup
- How to get the total count of Favorite/Favorited authors
- Attaching an upload to a user
- number of posts with “Load More”
- Get the total Author Favorited posts
- Gravity Forms on submit return value on same page
- media_handle_upload fails with gravity form submitted image
- CountPost WordPress Custom Taxonomy
- For each 3 posts, show a different post type
- Gravity Forms Marketo Plugin Feed [closed]
- WP_Query count of different meta key values [duplicate]
- divide custom field values in div every two values
- How to get the count for each taxonomy term
- Retrieve IDs from custom field, count and display results differently according to count
- Adding Gravity Form With if(is_page) Is Not Working
- get the count of table rows
- How to add together (get the sum) a field from all author’s posts
- How to calculate posts number? [closed]
- Gravity Forms – Prevent Multiple Form Entries Same User ID with Same Field Value
- How make animation increase of number
- Code working in functions.php but not pluign for gavity forms
- Having problems getting the number of plays in a WordPress Playlist from an audio file
- How to show the amount of post that have on the site?
- Count the number of matching post names in foreach loop
- Convert timestamp to readable date/time PHP
- Create own WordPress shortcode gallery
- Display related posts without a plugin
- How to check if a category has a parent and child categories?
- Accessing Global Vars & Functions in custom php page
- WordPress jQuery Post – Amending Variable Value Within Function Command
- Exclude a ‘portfolio’ custom category?