Added examples and various see also's

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@128327 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-05-21 23:09:07 +00:00
parent 23c409d0e6
commit da7e1e866c

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry id="function.str-word-count">
<refnamediv>
<refname>str_word_count</refname>
@ -43,6 +43,61 @@
string containing alphabetic characters, which also may contain, but not start
with &quot;'&quot; and &quot;-&quot; characters.
</para>
<para>
<example>
<title>Example uses for <function>str_word_count</function></title>
<programlisting role="php">
<![CDATA[
<?php
$str = "Hello friend, you're
looking good today!";
$a = str_word_count($str, 1);
$b = str_word_count($str, 2);
$c = str_word_count($str);
print_r($a);
print_r($b);
print $c;
/* Output may look like:
Array
(
[0] => Hello
[1] => friend
[2] => you're
[3] => looking
[4] => good
[5] => today
)
Array
(
[0] => Hello
[6] => friend
[14] => you're
[29] => looking
[46] => good
[51] => today
)
6
*/
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>explode</function>,
<function>preg_split</function>,
<function>split</function>,
<function>count_chars</function>, and
<function>substr_count</function>.
</para>
</refsect1>
</refentry>