Originariamente inviato da MrSman
Se posta un esempio forse sarà tutto più chiaro
Ciao,io sto usando il seguente codice che comprende una regex,come faccio a dire a questa regex di non prendere ne css ne javascript?
Codice PHP:
//Esporto descrizione
$input2 = @file_get_contents($link) or die('Could not access file: $url');
$regexp2 = "/\s<div id=\"singlePost\">(.*)<li class=\"sharing_label\">/siU";
preg_match_all("$regexp2", $input2, $matches2, PREG_SET_ORDER);
foreach($matches2 as $match2) {
//print_r($match);
$Vetrina2 = $match2[0];
}
$Vetrina2= str_replace( "vetrina2","RomanelliDiv2",$Vetrina2);
$titolo2=strip_tags($Vetrina2);
$description = utf8_decode($titolo2);
echo"Descrizione:$description";