cvs: phpdoc /en/reference/strings/functions htmlentities.xml md5.xml sha1.xml strlen.xml

From: Date: Thu, 24 Jul 2003 09:13:46 +0000
Subject: cvs: phpdoc /en/reference/strings/functions htmlentities.xml md5.xml sha1.xml strlen.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355459@lists.php.net to get a copy of this message
philip Thu Jul 24 05:13:46 2003 EDT Modified files: /phpdoc/en/reference/strings/functions htmlentities.xml md5.xml sha1.xml strlen.xml Log: Added an example. Index: phpdoc/en/reference/strings/functions/htmlentities.xml diff -u phpdoc/en/reference/strings/functions/htmlentities.xml:1.9 phpdoc/en/reference/strings/functions/htmlentities.xml:1.10 --- phpdoc/en/reference/strings/functions/htmlentities.xml:1.9 Mon Mar 3 13:03:12 2003 +++ phpdoc/en/reference/strings/functions/htmlentities.xml Thu Jul 24 05:13:45 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.htmlentities"> <refnamediv> @@ -67,6 +67,24 @@ <para> If you're wanting to decode instead (the reverse) you can use <function>html_entity_decode</function>. + </para> + <para> + <example> + <title>A <function>htmlentities</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$str = "A 'quote' is <b>bold</b>"; + +// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt; +echo htmlentities($str); + +// Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt; +echo htmlentities($str, ENT_QUOTES); +?> +]]> + </programlisting> + </example> </para> <para> See also <function>html_entity_decode</function>, Index: phpdoc/en/reference/strings/functions/md5.xml diff -u phpdoc/en/reference/strings/functions/md5.xml:1.6 phpdoc/en/reference/strings/functions/md5.xml:1.7 --- phpdoc/en/reference/strings/functions/md5.xml:1.6 Wed May 7 17:31:30 2003 +++ phpdoc/en/reference/strings/functions/md5.xml Thu Jul 24 05:13:45 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.135 --> <refentry id="function.md5"> <refnamediv> @@ -27,6 +27,23 @@ PHP 5.0.0 and defaults to &false; </simpara> </note> + <para> + <example> + <title>A <function>md5</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$str = 'apple'; + +if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f') { + echo "Would you like a green or red apple?"; + exit; +} +?> +]]> + </programlisting> + </example> + </para> <para> See also <function>crc32</function>, <function>md5_file</function>, and <function>sha1</function>. Index: phpdoc/en/reference/strings/functions/sha1.xml diff -u phpdoc/en/reference/strings/functions/sha1.xml:1.5 phpdoc/en/reference/strings/functions/sha1.xml:1.6 --- phpdoc/en/reference/strings/functions/sha1.xml:1.5 Wed May 7 17:31:30 2003 +++ phpdoc/en/reference/strings/functions/sha1.xml Thu Jul 24 05:13:45 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.sha1"> <refnamediv> <refname>sha1</refname> @@ -26,6 +26,23 @@ PHP 5.0.0 and defaults to &false; </simpara> </note> + <para> + <example> + <title>A <function>sha1</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$str = 'apple'; + +if (sha1($str) === 'd0be2dc421be4fcd0172e5afceea3970e2f3d940') { + echo "Would you like a green or red apple?"; + exit; +} +?> +]]> + </programlisting> + </example> + </para> <simpara> See also <function>sha1_file</function>, <function>crc32</function>, and <function>md5</function> Index: phpdoc/en/reference/strings/functions/strlen.xml diff -u phpdoc/en/reference/strings/functions/strlen.xml:1.2 phpdoc/en/reference/strings/functions/strlen.xml:1.3 --- phpdoc/en/reference/strings/functions/strlen.xml:1.2 Wed Apr 17 02:44:23 2002 +++ phpdoc/en/reference/strings/functions/strlen.xml Thu Jul 24 05:13:45 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.strlen"> <refnamediv> @@ -14,6 +14,25 @@ </methodsynopsis> <para> Returns the length of <parameter>string</parameter>. + </para> + <para> + <example> + <title>A <function>strlen</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$str = 'abcdef'; +echo strlen($str); // 6 + +$str = ' ab cd '; +echo strlen($str); // 7 +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>count</function>. </para> </refsect1> </refentry>

« previous php.doc (#969355459) next »