|
Posted by Baron Samedi on 05/19/06 12:34
I want to extend the PHP based blog system which I use.
We have static templates for the various blog pages and I would like to
introduce some logic to them.
That is, I want to have some sort of structure, like
[[if <condition>]]
[[else]]
[[endif]]
or [[for 0, 3]] // do 4 time
[[endfor]]
but I am bogged down at the very first hurdle, which is just evaluating
something like '2 == 2.".
The text from the templates will be seen as a string, of course, but
when I try to evaluate it as a bool,
echo 'Evaluated condition: "' . (bool) $text . '"<br>';
it always evaluates to true, even if my condition is '2 == 3'.
Obviously I am missing something very basic about evaluation and maybe
casting.
Can anyone enlighten me, please?
[Back to original message]
|