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/function.set-magic-quotes-runtime.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.set-magic-quotes-runtime.php',
   
1 => 'set_magic_quotes_runtime',
  ),
 
'up' =>
  array (
   
0 => 'ref.info.php',
   
1 => 'PHP Options/Info Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.set-include-path.php',
   
1 => 'set_include_path',
  ),
 
'next' =>
  array (
   
0 => 'function.set-time-limit.php',
   
1 => 'set_time_limit',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.set-magic-quotes-runtime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">set_magic_quotes_runtime</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">set_magic_quotes_runtime</span> &mdash; <span class="dc-title">Sets the current active configuration setting of magic_quotes_runtime</span></p>

 </div>
 
 <a name="function.set-magic-quotes-runtime.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><b>set_magic_quotes_runtime</b></span>
    ( <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$new_setting</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Set the current active configuration setting of <a href="info.configuration.php#ini.magic-quotes-runtime" class="link">magic_quotes_runtime</a>.
  </p>
  <div class="warning"><b class="warning">Warning</b><p class="simpara">This function has been
<em class="emphasis">DEPRECATED</em> as of PHP 5.3.0 and <em class="emphasis">REMOVED</em>
as of PHP 6.0.0. Relying on this feature is highly discouraged.</p></div>
 </div>


 <a name="function.set-magic-quotes-runtime.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">new_setting</tt></i>
</span>

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

      <p class="para">
       <b><tt class="constant">FALSE</tt></b> for off, <b><tt class="constant">TRUE</tt></b> for on.
      </p>
     </dd>

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


 <a name="function.set-magic-quotes-runtime.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
  </p>
 </div>


 <a name="function.set-magic-quotes-runtime.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>set_magic_quotes_runtime()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Create&nbsp;a&nbsp;temporary&nbsp;file&nbsp;pointer<br /></span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">tmpfile</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">//&nbsp;Write&nbsp;some&nbsp;data&nbsp;to&nbsp;the&nbsp;pointer<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'\'PHP\'&nbsp;is&nbsp;a&nbsp;Recursive&nbsp;acronym'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Without&nbsp;magic_quotes_runtime<br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">set_magic_quotes_runtime</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">'Without&nbsp;magic_quotes_runtime:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;With&nbsp;magic_quotes_runtime<br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">set_magic_quotes_runtime</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">'With&nbsp;magic_quotes_runtime:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Clean&nbsp;up<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<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>
Without magic_quotes_runtime: &#039;PHP&#039; is a Recursive acronym
With magic_quotes_runtime: \&#039;PHP\&#039; is a Recursive acronym
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.set-magic-quotes-runtime.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.get-magic-quotes-gpc.php" class="function" rel="rdfs-seeAlso">get_magic_quotes_gpc()</a> - Gets the current configuration setting of magic quotes gpc</li>
    <li class="member"><a href="function.get-magic-quotes-runtime.php" class="function" rel="rdfs-seeAlso">get_magic_quotes_runtime()</a> - Gets the current active configuration setting of magic_quotes_runtime</li>
   </ul><p>
  </p>
 </div>


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