PHP » PYTHON |
login |
register |
about
|
PYTHON substr_count
is this article helpful?
|
Python replacement for PHP's substr_count
[
edit
| history
]
result = haystack.count(needle) result = haystack.count(needle, offset) result = haystack.count(needle, offset, offset+length) substr_count(PHP 4, PHP 5) substr_count — Count the number of substring occurrences Description
int substr_count
( string $haystack
, string $needle
[, int $offset= 0
[, int $length
]] )
substr_count() returns the number of times the needle substring occurs in the haystack string. Please note that needle is case sensitive.
Parameters
Return ValuesThis functions returns an integer. Changelog
Examples
Example #1 A substr_count() example
<?php
See Also
|
more
Recently updated
more
Most requested
|