1 (edited by Yusupov357 2018-11-21 07:57:31)

Topic: Count number of commas in string

How can I count the number of times a comma appears in a string such as this?

A,B,C,D

It should return "3"

Mobdro

Re: Count number of commas in string

Please try this string:
echo substr_count('A,B,C,D', ',');

Best regards,
CN Support team

Re: Count number of commas in string

Support_Team wrote:

Please try this string:
echo substr_count('A,B,C,D', ',');

I just tray that and It's not working..

MyAccountAccess Login

4 (edited by mobinasalami3.1519 2022-10-21 04:57:59)

Re: Count number of commas in string

This works really well for us, thank you!
https://www.dunkinrunsonyou.run/