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. 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. 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? 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(...); 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 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
Archived
This topic is now archived and is closed to further replies.