⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phardata.offsetset.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>set the contents of a file within the tar/zip to those of an external file or string</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="phardata.iswritable.html">PharData::isWritable</a></div> <div class="next" style="text-align: right; float: right;"><a href="phardata.offsetunset.html">PharData::offsetUnset</a></div> <div class="up"><a href="class.PharData.html">PharData</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="phardata.offsetset" class="refentry"> <div class="refnamediv">  <h1 class="refname">PharData::offsetSet</h1>  <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">PharData::offsetSet</span> &mdash; <span class="dc-title">set the contents of a file within the tar/zip to those of an external file or string</span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type"><span class="type void">void</span></span> <span class="methodname"><b><b>PharData::offsetSet</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$offset</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$value</tt></span>   )</div>  <p class="para rdfs-comment">   This is an implementation of the <span class="interfacename">ArrayAccess</span> interface allowing   direct manipulation of the contents of a tar/zip archive using   array access brackets.  offsetSet is used for modifying an   existing file, or adding a new file to a tar/zip archive.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">offset</tt></i></span>     <dd>      <p class="para">       The filename (relative path) to modify in a tar or zip archive.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">value</tt></i></span>     <dd>      <p class="para">       Content of the file.      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   No return values.  </p> </div> <div class="refsect1 errors">  <h3 class="title">Errors/Exceptions</h3>  <p class="para">   Throws   <a href="class.PharException.html" class="classname">PharException</a> if there are any problems flushing   changes made to the tar/zip archive to disk.  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 A <b>PharData::offsetSet()</b> example</b></p>    <div class="example-contents"><p>     offsetSet should not be accessed directly, but instead used     via array access with the <i>[]</i> operator.    </p></div>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$p&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">PharData</span><span style="color: #007700">(</span><span style="color: #DD0000">'/path/to/my.tar'</span><span style="color: #007700">);<br />try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;calls&nbsp;offsetSet<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$p</span><span style="color: #007700">[</span><span style="color: #DD0000">'file.txt'</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #DD0000">'Hi&nbsp;there'</span><span style="color: #007700">;<br />}&nbsp;catch&nbsp;(</span><span style="color: #0000BB">Exception&nbsp;$e</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Could&nbsp;not&nbsp;modify&nbsp;file.txt:'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="phar.offsetset.html" class="function" rel="rdfs-seeAlso">Phar::offsetSet()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="phardata.iswritable.html">PharData::isWritable</a></div> <div class="next" style="text-align: right; float: right;"><a href="phardata.offsetunset.html">PharData::offsetUnset</a></div> <div class="up"><a href="class.PharData.html">PharData</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

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