com.examples.arrays.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 48 行

HTML
48
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Arrays and Array-style COM properties</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="com.examples.html">Examples</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.com.html">COM Functions</a></div> <div class="up"><a href="com.examples.html">Examples</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="com.examples.arrays" class="section">  <h2 class="title">Arrays and Array-style COM properties</h2>  <p class="para">   Many COM objects expose their properties as arrays, or using array-style   access.  In PHP 4, you may use PHP array syntax to read/write such a   property, but only a single dimension is allowed.  If  you want to read a   multi-dimensional property, you could instead make the property access   into a function call, with each parameter representing each dimension of   the array access, but there is no way to write to such a property.  </p>  <p class="para">   PHP 5 introduces the following new features to make your life easier:   <ul class="itemizedlist">    <li class="listitem">     <p class="para">      Access multi-dimensional arrays, or COM properties that require      multiple parameters using PHP array syntax.  You can also write or set      properties using this technique.     </p>    </li>    <li class="listitem">     <p class="para">      Iterate SafeArrays (&quot;true&quot; arrays) using the <a href="control-structures.foreach.html" class="xref">foreach</a> control structure.  This works      because SafeArrays include information about their size.  If an      array-style property implements IEnumVariant then you can also use      foreach for that property too; take a look at <a href="com.examples.html" class="xref">Examples</a> for more information on this topic.     </p>    </li>   </ul>  </p> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="com.examples.html">Examples</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.com.html">COM Functions</a></div> <div class="up"><a href="com.examples.html">Examples</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?