templates, regex and HTML

From: Date: Tue, 26 Sep 2000 01:44:34 +0000
Subject: templates, regex and HTML
Groups: php.general 
Request: Send a blank email to php-general+get-17475@lists.php.net to get a copy of this message
Hi, I have a couple of questions having to do with templates and regular expressions. The HTML document should look like this: ---------------- <TITLE>{title}</TITLE> ... <P>some text here</P> <!--This loops a list of items--> <LOOP TYPE="loop_list"> <TR><TD>{loop:VARIABLE_HERE}</TD></TR> </LOOP> <BR><BR> <!--This loops another, different list of items--> <LOOP TYPE="loop_list2"> <TR><TD>{loop:VARIABLE_HERE}</TD></TR> </LOOP> ---------------- 1) Is there a better/easier/more standerd way to do this? 2)How would I allow for different results based on whether or not the loop is odd or even ($i % 0)? ie, Would you suggest <ODD> and <EVEN> tags inside the <loop> tag? 3) What is the regular expression syntax? When I try... <LOOP TYPE="([^\"]*)">(.*)</LOOP> ...it grabs everything between the very first <LOOP TYPE="loop_list"> and the very last </LOOP> (it does not just save the results of each <LOOP> tag.) Thanks in advance, Bill Zeller __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/

« previous php.general (#17475) next »