<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.misc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.php-strip-whitespace.php',
    1 => 'php_strip_whitespace',
    2 => 'Return source with stripped comments and whitespace',
  ),
  'up' => 
  array (
    0 => 'ref.misc.php',
    1 => 'Функції Misc.',
  ),
  'prev' => 
  array (
    0 => 'function.pack.php',
    1 => 'pack',
  ),
  'next' => 
  array (
    0 => 'function.sapi-windows-cp-conv.php',
    1 => 'sapi_windows_cp_conv',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/misc/functions/php-strip-whitespace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.php-strip-whitespace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">php_strip_whitespace</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">php_strip_whitespace</span> &mdash; <span class="dc-title">Return source with stripped comments and whitespace</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.php-strip-whitespace-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>php_strip_whitespace</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Returns the PHP source code in <code class="parameter">filename</code> with
   PHP comments and whitespace removed. This may be useful for determining the
   amount of actual code in your scripts compared with the amount of comments.
   This is similar to using <strong class="command">php -w</strong> from the
   <a href="features.commandline.php" class="link">commandline</a>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.php-strip-whitespace-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Path to the PHP file.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.php-strip-whitespace-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   The stripped source code will be returned on success, or an empty string
   on failure.
  </p>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    This function respects the value of the
    <a href="ini.core.php#ini.short-open-tag" class="link">short_open_tag</a>
    ini directive.
   </p>
  </p></blockquote>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.php-strip-whitespace-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>php_strip_whitespace()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// PHP comment here<br /><br />/*<br /> * Another PHP comment<br /> */<br /><br /></span><span style="color: #007700">echo        </span><span style="color: #0000BB">php_strip_whitespace</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// Newlines are considered whitespace, and are removed too:<br /></span><span style="color: #0000BB">do_nothing</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Поданий вище приклад
виведе:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">&lt;?php
 echo php_strip_whitespace(__FILE__); do_nothing(); ?&gt;</pre>
</div>
    </div>
    <div class="example-contents"><p>
     Notice the PHP comments are gone, as are the whitespace and newline
     after the first echo statement.
    </p></div>
   </div>
  </p>
 </div>


</div><?php manual_footer($setup); ?>