|
|
Seo forumsSEO generalSEO scripts SEO tools Optimization Pagerank Dance Adsense Adwords Yahoo!NewsOptimization MicrosoftNewsOptimization MarketingCoop networkPromotion Affiliations Domain names Link popularity Link exchange Directories Buy & sell Services Freebies DevelopmentProgrammingServer issues Multimedia Javascript Databases Security HTML AJAX CSS PHP OtherSearch enginesTraffic ranking Robot spiders E-Commerce Site reviews Keywords Misc.WelcomeSuggestions Miscellaneous Register Membership Links Help About ![]() |
PHP count occurencies
Hi all, I would like to know if there is a php function that allow to count the number of occurencies for a character or string in another string. Do you know such a function ? It would most probably be much faster than to explode / split an array then count the number of elements of this array. Thanks. guest-forchy (2010-01-21 23:28:50) PHP count occurencies Um, if you mean for example $str = "Hello world!, it's nice world!";and you would like to know how often "world!" occurs in the string, just use substr_count. $count = substr_count($str,"world");visit the manual ;) substr_count ficgs Suggestions www.phpbuilder.com/board/showthread.php?t=10287962 godbit.com/forum/viewtopic.php?id=4249 free.netartmedia.net/PHP/PHP63.html www.jonasjohn.de/snippets/php/line-statistics-by-file.htm www.webdeveloper.com/forum/showthread.php?t=161566 www.codecodex.com/wiki/index.php?title=Count_the_number_of_occurrences_of_a ficgs More suggestions This is a collaborative page, you may change the order of these suggestions by registering, then clicking the icons before the titles. www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_2177 www.bigresource.com/PHP-count-occurencies-in-an-array-3RGqh7wY.html www.phpclasses.org/browse/package/2653.html www.access-programmers.co.uk/forums/showthread.php?t=70465 www.weberdev.com/Manuals/PHP/function.substr-count.html phpexpertsforum.com/how-to-count-the-number-of-substring-occurencies-t952.h forums.tizag.com/showthread.php?t=12871 code.programmingsite.co.uk/c/count-occurrences-of-values-in-an-array.php www.codeguru.com/FORUM/showthread.php?p=1557469 www.phpcenter.de/de-html-manual/function.mb-substr-count.html www.mrexcel.com/forum/showthread.php?t=81856 zamov.online.fr/EXHTML/PHP/PHP47.html forums.macosxhints.com/showthread.php?t=46934 discuss.itacumens.com/index.php?topic=23551.0 www.cgiphp.com/about31979.html www.asap-utilities.com/blog/index.php/2008/07/02/count-the-occurrences-of-a www.plus2net.com/php_tutorial/string-count.php www.vbforums.com/showthread.php?t=532104 www.ozgrid.com/forum/showthread.php?t=91250 m.lifehacker.com.au/view.php?id=333938 www.dreamincode.net/code/snippet901.htm forge.mysql.com/tools/tool.php?id=65 www.xtremedotnettalk.com/showthread.php?t=96603 www.linuxjournal.com/article/7396 bogambilya.asti.dost.gov.ph/manual/en/function.substr-count.php
[Games online]
[Last topics]
[Glossary]
[Help]
[Membership]
[About]
[Social network] [Hot news] [Discussions] [Seo forums] [Meet people] [Directory] |
|
![]()
You comment I follow : Links included in comments will be "dofollow" if your post is not an obvious spam, comments are published instantly. Write upside down to your friends ! (works with MySpace, Twitter, Facebook, Youtube, MSN, Hi5, Bebo, Yahoo...) |