Array, $variable, $counter

Created on: 21.07.2024 14:15
Last update: 23.07.2024 12:17

english 271

Array, $variable, $counter

If you already have the values ​​from an array (these are separated by commas and output as a string) and you want to use them as a counter.

$variable = (your string from an array);

echo $variable; => is output as an example with the values ​​(one, two, three, four, five).

Now you need a counter that shows the number of values ​​as a counter, i.e. (5).

       $count_string = explode(",",$variable);
       foreach($count_string as $string) $return_string[$string]++;
       foreach($return_string as $return_single => $single_string) 

       $counter += ($single_string); // Adding together the individual values.
       echo $counter; // Here the result is shown as 5.

There are currently no product reviews.
Why your email address?
If necessary, I will contact you to help you with the implementation.
Your email address will not be made public.
Is this post helpful to you?
Information(1)
General information
 Free advertising
Post counter
Current information status:
Categories: 9
Posts: 104
Support pages: 57
Downloads for members: 104
Download counter: 646
Reviews total72
Companies: 34
Support: 31
Information: 7