I use a program call php easy calendar. Into that, there is a lot of php file, most of them good php or HTML. In some file, there is some variable written in bracket like [time] [date] and so on…. it output a perfect valid value nicely formatted…
because the content of the file that DO something are encrypted with ioncude (what a shame) i cannot learn how they do that… is it a php function or a template engine…
can you explain to me, how to get a echo of a variable by telling it’s name like [name]
please share the light !
maybe it’s a template system, because when i try to use php function, it just don do anything
as request here is the code in file modern.php
<!--head-->
<style type="text/css">
<!--
.tableListings {
width: 450px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 10px;
margin-left: 0px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #666666;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 10px;
padding-left: 0px;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
line-height: 15px;
}
.tableDate {
color: #000000;
font-weight: bold;
}
.tableTitle {
color: #812459;
font-weight: bold;
}
.tableCategory {
width: 8px;
}
.tableDescr {
color: #000000;
font-weight: normal;
}
.tableTime {
color: #000000;
font-weight: normal;
}
.newDate {
color: #000000;
}
.newTime {
color: #666666;
}
-->
</style>
<!--head-->
<!--body-->
<table class="tableListings" [mouseover]>
<tr>
<!-- <td align="left" valign="top" class="tableCategory s2[category]">-->
<td align="left" valign="top" >
<span class="tableDate">[date]</span> - <span class="newTime">[time]</span><br />
<span class="tableTitle">[title]</span>
<span class="tableDescr">[descr]</span>
<!-- <span class="tableDescr">[categories]</span>
<span class="tableDescr">[category]</span>
-->
</td>
</tr>
</table>
<!--body-->
<!--foot-->
<!--foot-->
<!--empty-->
<table border="0" class="tableListings tableTime">
<tr>
<td bgcolor="#FFFFFF"><center>
Il n'y a pas d'événement au calendrier
</center></td>
</tr>
</table>
<!--empty-->
Yes, that’s some sort of custom template feature.
It’s not any functionality that PHP ships with out of the box.
As for how to do that yourself, a very quick and dirty way are regular expressions:
It may be much simpler or much more complicated than this, there are infinite ways to do this.