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/fr/function.php-strip-whitespace.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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 => 'fr',
  ),
 
'this' =>
  array (
   
0 => 'function.php-strip-whitespace.php',
   
1 => 'php_strip_whitespace',
  ),
 
'up' =>
  array (
   
0 => 'ref.misc.php',
   
1 => 'Fonctions diverses',
  ),
 
'prev' =>
  array (
   
0 => 'function.php-check-syntax.php',
   
1 => 'php_check_syntax',
  ),
 
'next' =>
  array (
   
0 => 'function.show-source.php',
   
1 => 'show_source',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.php-strip-whitespace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">php_strip_whitespace</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">php_strip_whitespace</span> &mdash; <span class="dc-title">Retourne la source sans commentaires, ni espaces blancs</span></p>

 </div>

 <a name="function.php-strip-whitespace.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><b>php_strip_whitespace</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filename</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Retourne le code source PHP du paramètre <i><tt class="parameter">filename</tt></i>

   en ayant supprimé les commentaires ainsi que les espaces. Cela peut être
   utile pour comparer la quantité de code avec la quantité de commentaire dans
   votre code. Cela revient à utiliser la commande <strong class="command">php -w</strong>
   depuis la <a href="features.commandline.php" class="link">ligne de commande</a>.
  </p>
 </div>


 <a name="function.php-strip-whitespace.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

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

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

      <p class="para">
       Chemin vers le fichier PHP.
      </p>
     </dd>

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


 <a name="function.php-strip-whitespace.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Le code source nettoyé sera retourné en cas de succès ou une chaîne
   vide en cas d&#039;échec.
  </p>
  <blockquote><p><b class="note">Note</b>:
  
    Cette fonction fonctionne comme décrite depuis PHP 5.0.1. Avant, elle ne retournait
    qu&#039;une chaîne vide. Pour plus de détails concernant ce bogue ainsi que son comportement
    précédent, lisez le rapport de bogue
    <a href="http://bugs.php.net/29606" class="link external">&raquo; #29606</a>.
   <br />
  </p></blockquote>
 </div>


 <a name="function.php-strip-whitespace.examples"></a><div class="refsect1 examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Exemple #1 Exemple avec <b>php_strip_whitespace()</b></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;Commentaire&nbsp;PHP&nbsp;ici<br /><br />/*<br />&nbsp;*&nbsp;Un&nbsp;autre&nbsp;commentaire&nbsp;PHP<br />&nbsp;*/<br /><br /></span><span style="color: #007700">echo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">//&nbsp;Les&nbsp;nouvelles&nbsp;lignes&nbsp;sont&nbsp;considérées&nbsp;comme&nbsp;des&nbsp;espaces&nbsp;et&nbsp;sont&nbsp;donc&nbsp;également&nbsp;effacées&nbsp;:<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 para"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
&lt;?php
 echo php_strip_whitespace(__FILE__); do_nothing(); ?&gt;
</pre></div>
    </div>
    <div class="example-contents para"><p>
     Notez que les commentaires PHP ne sont plus là, tout comme les espaces et les
     nouvelles lignes après le premier <i>echo</i>.
    </p></div>
   </div><p>
  </p>
 </div>


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