highlight_string() (funzione PHP) restituisce una stringa con la sintassi PHP evidenziata (tramite i tag HTML).
tips&tricks
Sintassi
highlight_file($stringa, $return[facoltativo])
| parametro | descrizione |
|---|---|
| $stringa | La stringa da processare |
| $return | Valore booleano. Se true, restituisce il codice evidenziato come stringa; in mancanza (false) ne fa l’output (default) |
Esempi
highlight_string('<?php phpinfo(); ?>');
/* RISULTATO
<span style="color: #000000">
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
</span>
*/
Contenuti correlati
- CSS
- HTML
- JavaScript
- jQuery
- PHP
- SQL
- WORDPRESS
0 Comment