/php/function.mcrypt-list-modes.html

https://bitbucket.org/thncr/manuals · HTML · 95 lines · 77 code · 18 blank · 0 comment · 0 complexity · 45edc5d2507fed3485b041f134122b1c MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <title>Gets an array of all supported modes</title>
  6. </head>
  7. <body><div class="manualnavbar" style="text-align: center;">
  8. <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-list-algorithms.html">mcrypt_list_algorithms</a></div>
  9. <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-module-close.html">mcrypt_module_close</a></div>
  10. <div class="up"><a href="ref.mcrypt.html">Mcrypt 函数</a></div>
  11. <div class="home"><a href="index.html">PHP Manual</a></div>
  12. </div><hr /><div id="function.mcrypt-list-modes" class="refentry">
  13. <div class="refnamediv">
  14. <h1 class="refname">mcrypt_list_modes</h1>
  15. <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5)</p><p class="refpurpose"><span class="refname">mcrypt_list_modes</span> &mdash; <span class="dc-title">Gets an array of all supported modes</span></p>
  16. </div>
  17. <div class="refsect1 description" id="refsect1-function.mcrypt-list-modes-description">
  18. <h3 class="title">说明</h3>
  19. <div class="methodsynopsis dc-description">
  20. <span class="type">array</span> <span class="methodname"><strong>mcrypt_list_modes</strong></span>
  21. ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$lib_dir</code><span class="initializer"> = ini_get(&quot;mcrypt.modes_dir&quot;)</span></span>
  22. ] )</div>
  23. <p class="para rdfs-comment">
  24. Gets the list of all supported modes in the
  25. <em><code class="parameter">lib_dir</code></em> parameter.
  26. </p>
  27. </div>
  28. <div class="refsect1 parameters" id="refsect1-function.mcrypt-list-modes-parameters">
  29. <h3 class="title">参数</h3>
  30. <p class="para">
  31. <dl>
  32. <dt>
  33. <span class="term"><em><code class="parameter">lib_dir</code></em></span>
  34. <dd>
  35. <p class="para">
  36. Specifies the directory where all modes are located. If not
  37. specified, the value of the <em>mcrypt.modes_dir</em>
  38. <var class="filename">php.ini</var> directive is used.
  39. </p>
  40. </dd>
  41. </dt>
  42. </dl>
  43. </p>
  44. </div>
  45. <div class="refsect1 returnvalues" id="refsect1-function.mcrypt-list-modes-returnvalues">
  46. <h3 class="title">返回值</h3>
  47. <p class="para">
  48. Returns an array with all the supported modes.
  49. </p>
  50. </div>
  51. <div class="refsect1 examples" id="refsect1-function.mcrypt-list-modes-examples">
  52. <h3 class="title">范例</h3>
  53. <p class="para">
  54. <div class="example" id="example-882">
  55. <p><strong>Example #1 <span class="function"><strong>mcrypt_list_modes()</strong></span> Example</strong></p>
  56. <div class="example-contents">
  57. <div class="phpcode"><code><span style="color: #000000">
  58. <span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$modes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mcrypt_list_modes</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$modes&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$mode</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$mode</span><span style="color: #DD0000">&nbsp;&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span>
  59. </span>
  60. </code></div>
  61. </div>
  62. <div class="example-contents"><p>
  63. The example above will produce a list with all supported
  64. algorithms in the default mode directory. If it is not set
  65. with the <em>mcrypt.modes_dir</em> <var class="filename">php.ini</var>
  66. directive, the default directory of mcrypt is used (which
  67. is <var class="filename">/usr/local/lib/libmcrypt</var>).
  68. </p></div>
  69. </div>
  70. </p>
  71. </div>
  72. </div><hr /><div class="manualnavbar" style="text-align: center;">
  73. <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-list-algorithms.html">mcrypt_list_algorithms</a></div>
  74. <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-module-close.html">mcrypt_module_close</a></div>
  75. <div class="up"><a href="ref.mcrypt.html">Mcrypt 函数</a></div>
  76. <div class="home"><a href="index.html">PHP Manual</a></div>
  77. </div></body></html>