john_bboy7 Posted October 10, 2010 Share Posted October 10, 2010 I don't actually want the results i want the total number of matches it found from the pattern but i am not able to get the numbers. any help. Quote Link to comment https://forums.phpfreaks.com/topic/215550-how-to-get-total-number-of-matches/ Share on other sites More sharing options...
Alex Posted October 10, 2010 Share Posted October 10, 2010 Assuming you're using preg_match, it returns the number of matches. Quote Link to comment https://forums.phpfreaks.com/topic/215550-how-to-get-total-number-of-matches/#findComment-1120837 Share on other sites More sharing options...
john_bboy7 Posted October 10, 2010 Author Share Posted October 10, 2010 Assuming you're using preg_match, it returns the number of matches. I am using preg match all. But if i am using preg match. how should i echo the output? Quote Link to comment https://forums.phpfreaks.com/topic/215550-how-to-get-total-number-of-matches/#findComment-1120838 Share on other sites More sharing options...
Alex Posted October 10, 2010 Share Posted October 10, 2010 preg_match_all returns the same thing (see the documentation). Just echo what it returns. echo preg_match_all(...); Quote Link to comment https://forums.phpfreaks.com/topic/215550-how-to-get-total-number-of-matches/#findComment-1120842 Share on other sites More sharing options...
john_bboy7 Posted October 10, 2010 Author Share Posted October 10, 2010 oh my bad. I feel stupid now Anyhow thanks for helping me out. RESOLVED Quote Link to comment https://forums.phpfreaks.com/topic/215550-how-to-get-total-number-of-matches/#findComment-1120849 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.