peternguyen
New Member
I need to find the number of times a needle appears in a haystack. Until this point I've put together the following code:\[code\]<?php$haystack = 'http://www.google.com';$needle = 'a';$contents = file_get_contents($haystack);?>\[/code\]I want to find the number of times 'a' (the needle) appears in $contents (haystack - google.com's source code).Thank you