SF23103 Posted March 12, 2014 Share Posted March 12, 2014 I'm stuck. Any ideas on the easiest way to count specific php tags in a MySQL row? I want to count the number of <p> tags in a particular MySQL row, in order to determine which DIV to use. Quote Link to comment https://forums.phpfreaks.com/topic/286898-count-html-tags-in-mysql-row/ Share on other sites More sharing options...
Solution trq Posted March 12, 2014 Solution Share Posted March 12, 2014 substr_count. Quote Link to comment https://forums.phpfreaks.com/topic/286898-count-html-tags-in-mysql-row/#findComment-1472253 Share on other sites More sharing options...
SF23103 Posted March 12, 2014 Author Share Posted March 12, 2014 You got it! Thanks!! $paragraph_count = substr_count($sql_row_text, '<P>'); Quote Link to comment https://forums.phpfreaks.com/topic/286898-count-html-tags-in-mysql-row/#findComment-1472257 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.