Realizzazione by siti.web.firenze e web.at.work

contatti
realizzazione siti web

PHP togliere i tag da stringa html con preg_replace

In PHP per escludere i tag dal codice HTML si utilizza la funzione:

<?php
$stringa_html = '<p>Questa è una <b>stringa</b> HTML</p>';
echo preg_replace("/(</?)(w+)([^>]*>)/i",'',$stringa_html, -1);

Restituisce:

Questa è una stringa HTML

?>

 

separatore

Informazioni sull'autore

Sergio Ferraiolo

foto
Descrizione:

Web Master di webdesignfirenze.com, titolare di web.at.work che ha realizzato il sito.

Mansioni: Programmatore, web designer e Analista