Rapide Advanced Adulte
 
 Web|Image|Shop|Video|News|Wmx|Mobile|Wiki|Ajouter ce moteur

     Manuel PHP     
Partager
 
 
Partager
Partager

 

Table :

.connection aborted
.connection status
.connection timeout
.constant
.define
.defined
.die
.exit()
.eval
.exit
.get browser
. halt compiler
.highlight file
.highlight string
.ignore user abort
.pack
.php check syntax
.php strip whitespace
.show source
.highlight file()
.sleep
.sys getloadavg
.time nanosleep
.time sleep until
.uniqid
.unpack
.usleep
 
   

  highlight_string  


highlight_string

(PHP 4, PHP 5)

highlight_string -- Applique la syntaxe colorisée à du code PHP

Description

mixed highlight_string ( string str [, bool return] )

highlight_string() affiche la version colorisée du code PHP contenu dans le paramètre str, en utilisant les couleurs du système interne de colorisation de PHP.

Si le second paramètre optionnel return est fourni, et vaut TRUE alors highlight_string() retournera la chaîne colorisée au lieu de l'afficher immédiatement. Si le second paramètre ne vaut pas TRUE alors highlight_string() retournera TRUE en cas de succès, et FALSE sinon.

Note : Cette fonction utilise en interne le buffer de sortie avec ce paramètre, il ne peut donc pas être utilisé dans la fonction de callback ob_start().

Exemple 1. Exemple avec highlight_string()

<?php
highlight_string
('<?php phpinfo(); ?>');
?>

Cet exemple affichera (en PHP 4):

<code><font color="#000000">
<font color="#0000BB">&lt;?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font>
</font>
</code>

Cet exemple affichera (en PHP 5):

<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?&gt;</span>
</span>
</code>

Note : Le paramètre return est disponible depuis PHP 4.2.0. Auparavant, il prenait la valeur par défaut de FALSE

Voir aussi highlight_file() et show_source().


    Annonces       
 

 Retour au chapitre Php

 

Top
 

Ajouter JungleKey.fr à votre Explorateur

 
 

About Us | © 2007 JungleKey




iBlack | Mobile | Wiki | Ajouter ce moteur
.