Ich möchte gerne einen umfangreicherein Code-Teil als eine Variable definieren. Der Code enthält HTML und PHP.
Wer kann mir helfen damit? Klar ist, dass man die PHP Befehle verändern muss und zum Beispiel <? und ?> entfernen muss, weil man ja schon in einem PHP Script ist. "echo" wahrscheinlich auch... Ich habe bißchen probiert aber es nicht hingekriet, grade bei der Schleife nicht.
Habe leider auch nichts passendes gefunden. Ich poste hier meinen Orginal Code, also völlig unverändert. Der müsste also dann in eine Variable rein zum Beispiel:
$shows = "HIER DANN UNTENSTEHENDER CODE";
PHP-Code:
<table width='253' border='0' cellspacing='0' cellpadding='0' height='253'>
<tr>
<td id='bandselect'>
<table width='253' border='0' cellspacing='0' cellpadding='0' height='253'>
<tr>
<td background='y_bubble_a.gif'>
<table width='253' border='0' cellspacing='0' cellpadding='0' height='253'>
<tr>
<td width='44' height='55'> </td>
<td height='55'> </td>
<td width='70' height='55'> </td>
</tr>
<tr>
<td width='44'> </td>
<td valign='top'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center'><b><font face='Verdana' size='1'><a href='tour.php'>NEXT SHOWS</a><img src='spacer.gif' width='22' height='11'></font></b></td>
</tr>
<tr>
<td height='5'><img src='spacer.gif' width='100%' height='5'></td>
</tr>
<tr>
<td>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<?php
while ($gig = mysql_fetch_array($gigs, MYSQL_BOTH))
{
$datum = date('d.m.', strtotime($gig['datum']));
?>
<tr>
<td><b><font face='Verdana' size='1'>
<?php echo $datum; ?>
<font color='#FF0066'>
<?
setlocale ( LC_CTYPE, 'de_DE@euro');
echo strtoupper($gig['ort']);
?>
</font> </font></b></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
</td>
<td width='70'> </td>
</tr>
<tr>
<td width='44' height='50'> </td>
<td height='50'> </td>
<td width='70' height='50'> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>