note 33675 deleted from function.eval by alindeman

From: Date: Thu, 03 Jul 2003 16:00:07 +0000
Subject: note 33675 deleted from function.eval by alindeman
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-51468@lists.php.net to get a copy of this message
Note Submitter: paq@libero.it ---- /*in database ho HTML e PHP mischiato ecco come ho risolto per far scrivere HTML e per ottenere il PHP interpretato. ciao $srt = il risultato della query */ /*in a database i have a mix of HTML and PHP that's the way i get html and PHP $srt =result of a query ex: <table width="437" border="0" cellspacing="0" cellpadding="2" > <tr> <td width="213" bgcolor="#FFFFFF" align="center" class="text_blu">LOGO TIPO</td> <td width="232" class="text_small"><? echo $campo_array[XUIL104];?><br> <? echo $campo_array[XUIL104];?></td> </tr> </table> sorry for bad english */ $x= strlen($str); $start=0; $end =0; for ($RR=0;$RR<=$x;$RR++){ if($str[$RR] == "<" && $str[$RR+1] == "?") { $start = $RR + 2; } if($str[$RR] == "?" && $str[$RR+1] == ">") { $end = $RR ; $rrr = $end - $start; $php = str_replace("\"","'",substr($str, $start, $end - $start)); eval($php); $start=0; $RR=$RR+2; } if(!$start){ echo $str[$RR]; } }

« previous php.notes (#51468) next »