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

📄 function.sammessage-header.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
📖 第 1 页 / 共 2 页
字号:
     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Constant</th>       <th colspan="1">Type description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_BOOLEAN</td>       <td colspan="1" rowspan="1" align="left">        Any value passed will be interpreted as logical true or false.         If the value cannot be interpreted as a PHP boolean value the value        passed to the messaging system is undefined.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_BYTE</td>       <td colspan="1" rowspan="1" align="left">        An 8-bit signed integer value. SAM will attempt to convert the        property value specified into a single byte value to pass to the        messaging system. If a string value is passed an attempt will be        made to interpret the string as a numeric value. If the numeric        value cannot be expressed as an 8-bit signed binary value data may        be lost in the conversion.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_DOUBLE</td>       <td colspan="1" rowspan="1" align="left">        A long floating point value. SAM will attempt to convert the        property value specified into a floating point value with 15 digits        of precision. If a string value is passed an attempt will be made to        interpret the string as a numeric value. If the passed value cannot        be expressed as a 15 digit floating point value data may be lost in        the conversion.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_FLOAT</td>       <td colspan="1" rowspan="1" align="left">        A short floating point value. SAM will attempt to convert the        property value specified into a floating point value with 7 digits of        precision. If a string value is passed an attempt will be made to        interpret the string as a numeric value. If the passed value cannot        be expressed as a 7 digit floating point value data may be lost in        the conversion.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_INT</td>       <td colspan="1" rowspan="1" align="left">        An 32-bit signed integer value. SAM will attempt to convert the        property value specified into a 32-bit value to pass to the messaging        system. If a string value is passed an attempt will be made to        interpret the string as a numeric value. If the numeric value cannot        be expressed as an 32-bit signed binary value data may be lost in the        conversion.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_LONG</td>       <td colspan="1" rowspan="1" align="left">        An 64-bit signed integer value. SAM will attempt to convert the        property value specified into a 64-bit value to pass to the messaging        system. If a string value is passed an attempt will be made to        interpret the string as a numeric value. If the numeric value cannot        be expressed as an 64-bit signed binary value data may be lost in the        conversion.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">SAM_STRING</td>       <td colspan="1" rowspan="1" align="left">        SAM will interpret the property value specified as a string and pass        it to the messaging system accordingly.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #3 Setting properties as the sender of a message</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$msg&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SAMMessage</span><span style="color: #007700">(</span><span style="color: #DD0000">'This&nbsp;is&nbsp;a&nbsp;test&nbsp;message'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;defining&nbsp;SAM&nbsp;specific&nbsp;properties...<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">SAM_REPLY_TO&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'queue://test/replyQueue'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;defining&nbsp;arbitrary&nbsp;properties...<br />//<br />//&nbsp;a&nbsp;default&nbsp;string&nbsp;property<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myStringProp1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'a&nbsp;string&nbsp;property'</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;a&nbsp;string&nbsp;property&nbsp;with&nbsp;a&nbsp;type&nbsp;hint<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myStringProp2&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'another&nbsp;string&nbsp;property'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_STRING</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;a&nbsp;boolean&nbsp;property<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myBoolProp&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_BOOL</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;numeric&nbsp;format&nbsp;properties<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myIntProp&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">32768</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_INT</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myLongProp&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">9876543</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_LONG</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myByteProp1&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">123</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_BYTE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myByteProp2&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'12'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_BYTE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myFloatProp&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">3.141592</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_FLOAT</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">myDoubleProp&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #0000BB">3.14159265358979</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_DOUBLE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p>  <p class="para">   <div class="example">    <p><b>Example #4 Retreiving property values from a message</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;accessing&nbsp;an&nbsp;application&nbsp;specific&nbsp;property<br /></span><span style="color: #0000BB">$intProp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #DD0000">'MyIntProp'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;accessing&nbsp;a&nbsp;messaging&nbsp;system&nbsp;specific&nbsp;property<br /></span><span style="color: #0000BB">$encoding&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">-&gt;</span><span style="color: #DD0000">'JMS_IBM_Msgtype'</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="function.sammessage-body.html" class="xref">SAMMessage->body</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.sam.html">SAM Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="book.snmp.html">SNMP</a></div> <div class="up"><a href="ref.sam.html">SAM Functions</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 + -