Page 1 of 1

how to copy a block of codes?

Posted: Mon Apr 18, 2005 4:01 pm
by hongco
hi,

I would like to copy a block of code that is between these two lines of a template file:

<!-- BEGIN eblogs_list -->
...
<!-- BEGIN eblogs_list -->

i'd like to copy anything between the two lines above and save them into another array? how would you do that?
<td class=bluetext2 align=left valign=top bgcolor=#EBF8FB>
<span class=bluetext3>

<!-- BEGIN eblogs_list -->
{title} <br>
posted: {date} <br>
by: {username} <br>
{content}<br>
views: {views} | replies {comments}
<!-- END eblogs_list -->

</span>
<br>
</td>
<td width=16 bgcolor=#EBF8FB></td>
thank you :D

Posted: Mon Apr 18, 2005 4:32 pm
by method_man
i dont get it

Posted: Mon Apr 18, 2005 4:48 pm
by shiznatix
make the lines of html a php string and send them through a get variable if you want to send them to another file?

Posted: Mon Apr 18, 2005 8:13 pm
by feyd
regular expression.

Posted: Wed Apr 20, 2005 12:49 pm
by hongco

Code: Select all

define ('OPENING_TAG', '<!-- BEGIN eblogs_list -->');
define ('CLOSING_TAG', '<!-- END eblogs_list -->');

preg_match_all('/'.OPENING_TAG.'(.*)'.CLOSING_TAG.'/msiU', $input, $matches,PREG_SET_ORDER);