use this:
echo substr_count("abca", "a"); // will echo 2
More Related Contents:
- How can I combine two strings together in PHP?
- Make all words lowercase and the first letter of each word uppercase
- Truncate a string to first n characters of a string and add three dots if any characters are removed
- What kind of string is this? How do I unserialize this string? [duplicate]
- How to generate all permutations of a string in PHP?
- Remove multiple whitespaces
- PHP convert string to hex and hex to string
- Converting an integer to a string in PHP
- php implode (101) with quotes
- PHP substring extraction. Get the string before the first ‘/’ or the whole string
- Str_replace for multiple items
- Is a new line = \n OR \r\n?
- Best Practices: working with long, multiline strings in PHP?
- How to handle double quotes in string before XPath evaluation?
- Escape string to use in mail()
- How can I split a string in PHP at the nth occurrence of a needle?
- Getting the first character of a string with $str[0]
- PHP: Split multibyte string (word) into separate characters
- What does the b in front of string literals do?
- Highlight keywords in a paragraph
- Search and replace multiple values with multiple/different values in PHP5?
- Explode string into array with no empty elements?
- Get the sum of all digits in a numeric string
- Reverse the letters in each word of a string
- How to separate letters and digits from a string in php
- How does PHP compare strings with comparison operators?
- How do I get the byte values of a string in PHP?
- How to validate that a string only contain lowercase letters?
- Regex to match an IP address [closed]
- How do I detect non-ASCII characters in a string?