How can i parse {if game > 4}{somecontent}{/if}
from a template using PHP.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Correctly parse PDF paragraphs with Python
- Can php detect if javascript is on or not?
You can parse that syntax using smarty template engine.
http://www.smarty.net/crash_course
What's wrong with using plain old PHP? It's much faster and a whole lot simpler.
If you really insist, here's a start (untested):
This is pretty simple, it get's really hairy when you want to work with nested statements.