Andrea Loda
Andrea Loda

Reputation: 19

replacing words in PHP document

$festa = mysql_result($result,$i,"festa");
	  $data = mysql_result($result,$i,"data");
	  $luogo = mysql_result($result,$i,"luogo");
	  $prezzo = mysql_result($result,$i,"prezzo");
	  $dettagli = mysql_result($result,$i,"dettagli");
	  $bus = mysql_result($result,$i,"bus");
	  $organizzatore = mysql_result($result,$i,"organizzatore");
      
      $dettagli= ereg_replace("*TITOLO", '<font color="#E3161A">', $dettagli); 
      $dettagli= ereg_replace("*/TITOLO", "</font>", $dettagli);
      
      
        
      echo'<div id="latestadded"> <div class="titlebarpub"> #PUBBLICITA </div> <div class="pubblicita3"><script type="text/javascript">
document.write(\'<s\'+\'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=728X90/r=\'+new Date().getTime()+\'"></s\'+\'cript>\');
</script></div></div><br>';
	  echo "  <div class='titlebarpe'>
			 #$numerofesta $festa 
			 <br>
			 </div>
			 <br>
			 <img src='fotoorganizzatori/$organizzatore.png' class='immaginefestape'/>
			 <br>
			
			 <div class='informazionibase'>
			 <p align='left' style='margin-left: 10%;'>
			 <font color='#EBE440' class='soloformimpact'>DATA EVENTO : </font> $data <br>
			 <font color='#EBE440' class='soloformimpact'>LUOGO : </font> $luogo <br>
			 <font color='#EBE440' class='soloformimpact'>COSTO FESTA : </font>$prezzo <br>
			 </div>
			 </p>
			 
			 <div class='altreinformazioni'>
			 
			 
			 <font color='#EBE440' font-size:'+2' class='soloformimpact'> TUTTE LE ALTRE INFORMAZIONI </font><br>
			 <font color='#000000' class='soloformimpact'> <p align='left' style='margin-left: 10%;'> $dettagli </p> </font> <br>
			 </p>
			 </div>
			 
			 
			 ";
			/*PAGINA EVENTO*/ ?>

why the ereg_replace dosen't work? in my page if i put the ereg_replace it shows me nothing i searched in other sites to solve this problem but i can't find where is my error and i don't know what i do to solve this problem, thank you if you can help me

Upvotes: 1

Views: 52

Answers (1)

Solrac
Solrac

Reputation: 931

Try str_replace() instead:

$dettagli = str_replace("TITOLO","<font color=\"#E3161A\">", $dettagli);
$dettagli = str_replace("/TITOLO","</font>", $dettagli);

Upvotes: 1

Related Questions