cs1h Posted August 22, 2009 Share Posted August 22, 2009 Hi, Does anyone know how I would quickly count the number of commas in a string? (i.e. the string 1,2,3,4,5 has 4 commas) Thanks, Cs1h Quote Link to comment https://forums.phpfreaks.com/topic/171365-counting-commas/ Share on other sites More sharing options...
Maq Posted August 22, 2009 Share Posted August 22, 2009 substr_count seems to be what you're after. Quote Link to comment https://forums.phpfreaks.com/topic/171365-counting-commas/#findComment-903739 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.