svn: /phpdoc/en/trunk/reference/strings/functions/ metaphone.xml

From: Date: Sat, 17 Apr 2010 11:08:26 +0000
Subject: svn: /phpdoc/en/trunk/reference/strings/functions/ metaphone.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6391@lists.php.net to get a copy of this message
salathe Sat, 17 Apr 2010 11:08:26 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=298115 Log: describe phonemes (was phones) parameter for metaphone. added basic examples. closes #51578 Bug: http://bugs.php.net/51578 (Feedback) No elaboration on what $phones is Changed paths: U phpdoc/en/trunk/reference/strings/functions/metaphone.xml Modified: phpdoc/en/trunk/reference/strings/functions/metaphone.xml =================================================================== --- phpdoc/en/trunk/reference/strings/functions/metaphone.xml 2010-04-17 09:40:23 UTC (rev 298114) +++ phpdoc/en/trunk/reference/strings/functions/metaphone.xml 2010-04-17 11:08:26 UTC (rev 298115) @@ -11,7 +11,7 @@ <methodsynopsis> <type>string</type><methodname>metaphone</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>phones</parameter><initializer>0</initializer></methodparam> + <methodparam choice="opt"><type>int</type><parameter>phonemes</parameter><initializer>0</initializer></methodparam> </methodsynopsis> <para> Calculates the metaphone key of <parameter>str</parameter>. @@ -43,9 +43,12 @@ </listitem> </varlistentry> <varlistentry> - <term><parameter>phones</parameter></term> + <term><parameter>phonemes</parameter></term> <listitem> <para> + This parameter restricts the returned metaphone key to + <parameter>phonemes</parameter> characters in length. + The default value of <literal>0</literal> means no restriction. </para> </listitem> </varlistentry> @@ -56,10 +59,54 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the metaphone key as a string. + Returns the metaphone key as a string, &return.falseforfailure;. </para> </refsect1> + <refsect1 role="examples"><!-- {{{ --> + &reftitle.examples; + <para> + <example xml:id="metaphone.example.basic"><!-- {{{ --> + <title><function>metaphone</function> basic example</title> + <programlisting role="php"> +<![CDATA[ +<?php +var_dump(metaphone('programming')); +var_dump(metaphone('programmer')); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +string(7) "PRKRMNK" +string(6) "PRKRMR" +]]> + </screen> + </example><!-- }}} --> + </para> + <para> + <example xml:id="metaphone.example.phonemes"><!-- {{{ --> + <title>Using the <parameter>phonemes</parameter> parameter</title> + <programlisting role="php"> +<![CDATA[ +<?php +var_dump(metaphone('programming', 5)); +var_dump(metaphone('programmer', 5)); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +string(5) "PRKRM" +string(5) "PRKRM" +]]> + </screen> + </example><!-- }}} --> + </para> + </refsect1><!-- }}} --> + </refentry> <!-- Keep this comment at the end of the file

« previous php.doc.cvs (#6391) next »