downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/domprocessinginstruction.construct.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/class.domprocessinginstruction.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'domprocessinginstruction.construct.php',
   
1 => 'DOMProcessingInstruction::__construct',
  ),
 
'up' =>
  array (
   
0 => 'class.domprocessinginstruction.php',
   
1 => 'The DOMProcessingInstruction class',
  ),
 
'prev' =>
  array (
   
0 => 'class.domprocessinginstruction.php',
   
1 => 'DOMProcessingInstruction',
  ),
 
'next' =>
  array (
   
0 => 'class.domtext.php',
   
1 => 'DOMText',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="domprocessinginstruction.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMProcessingInstruction::__construct</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">DOMProcessingInstruction::__construct</span> &mdash; <span class="dc-title">
   Creates a new <a href="class.domprocessinginstruction.php" class="classname">DOMProcessingInstruction</a> object
  </span></p>

 </div>
 <a name="domprocessinginstruction.construct.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="classsynopsis">
   <div class="ooclass"><a href="class.domprocessinginstruction.php" class="classname">DOMProcessingInstruction</a></div>
   <div class="methodsynopsis dc-description">
     <span class="methodname"><b>__construct</b></span>
     ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$name</tt></span>
    [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$value</tt></span>
   ] )</div>
 
  </div>
  <p class="para">
   Creates a new <a href="class.domprocessinginstruction.php" class="classname">DOMProcessingInstruction</a> object.
   This object is read only. It may be appended to a document, but
   additional nodes may not be appended to this node until
   the node is associated with a document. To create a writeable node, use
   <a href="domdocument.createprocessinginstruction.php" class="xref">DOMDocument::createProcessingInstruction</a>.
  </p>
 </div>

 <a name="domprocessinginstruction.construct.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">name</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The tag name of the processing instruction.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">value</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The value of the processing instruction.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>

 <a name="domprocessinginstruction.construct.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 Creating a new <a href="class.domprocessinginstruction.php" class="classname">DOMProcessingInstruction</a> object</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$dom&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">(</span><span style="color: #DD0000">'1.0'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'UTF-8'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$html&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$dom</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">appendChild</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">DOMElement</span><span style="color: #007700">(</span><span style="color: #DD0000">'html'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$body&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$html</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">appendChild</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">DOMElement</span><span style="color: #007700">(</span><span style="color: #DD0000">'body'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$pinode&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">DOMProcessingInstruction</span><span style="color: #007700">(</span><span style="color: #DD0000">'php'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'echo&nbsp;"Hello&nbsp;World";&nbsp;'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$body</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">appendChild</span><span style="color: #007700">(</span><span style="color: #0000BB">$pinode</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$dom</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">saveXML</span><span style="color: #007700">();&nbsp;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;html&gt;&lt;body&gt;&lt;?php echo &quot;Hello World&quot;; ?&gt;&lt;/body&gt;&lt;/html&gt;
</pre></div>
    </div>
   </div><p>
  </p>
 </div>

 <a name="domprocessinginstruction.construct.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"> <span class="methodname"><a href="domdocument.createprocessinginstruction.php" class="function" rel="rdfs-seeAlso">DOMDocument::createProcessingInstruction</a> - Creates new PI node</span></li>
   </ul><p>
  </p>
 </div>

</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites