[ACCEPTED]-PHP - Count number of commas in string-php
Accepted answer
substr_count($my_string, ",")
If you wish to get all the elements between 1 commas as an array, you can always
$splitted = explode(",", $my_string)
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.