PDA

View Full Version : get last line tabs? possible?


Extreme43
08-10-2005, 07:31 AM
instead of writing out a table everytime i want to use one i just made a function to do it.....
the function is similar to

function opentable($width = "90%")
{
echo "
<table>
<tr>
<td>
";
}


but i want the source to look neat and tidy
and was wondering if it is possible to get the amount of tabs used in the line right before we use the function except the line before would be unpredictable
i cant think of anyway to do it....but....can anyone else?

donsipe
08-10-2005, 01:28 PM
You may want to look into "heredoc" string syntax.

function mk_table($width="100%") {
$str = <<<_HEREDOC_STR
<table width="{$width}">
<tr>
<td> </td>
</tr>
</table>
_HEREDOC_STR;
echo $str;
}