Hi there,
I am trying to get a list of data inside markers, which seemd to go fine in the start using this code:
<pre>
<?php
$html = '{PART}this is the first part{/PART}';
$html.= 'ffffd';
$html.= 'fggfgfgfgf';
eregi("{PART}(.*){/PART}", $html,$parts);
print_r($parts);
?>
</pre>
This would then give an array with the data inside the {PART} and {/PART}
However the problem comes when i add another part in like:
<pre>
<?php
$html = '{PART}this is the first part{/PART}';
$html.= 'ffffd';
$html.= 'fggfgfgfgf';
$html.= '{PART}this is the second part{/PART}';
eregi("{PART}(.*){/PART}", $html,$parts);
print_r($parts);
?>
</pre>
This then lists the content between the first {PART} and the last {/PART}
I want it to list both of them seperatly.
Anybody got any ideas?, sorry if it's not explained very well. The code is a lot more complicated than that but thats it down to the basics of what im trying to do.
Cheers, Craig