Reply to I need a mini "logic interpreter"

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация