right... I now have:
$quotes = 3;
$i = 0;
for($i = 1; $i < $quotes; $i++) {
$bbcode_regex = '/\[QUOTE user\=(.+?)](.+?)\[\/QUOTE\]/s';
$bbcode_replace = '<span class="Fquote">Previously, $1 said:<br /> $2</span>';
$replytext = preg_replace($bbcode_regex, $bbcode_replace, $replytext);
}
So I'm thinking I need a way of counting all the [/QUOTE]'s from the string so I can use this number as $quotes + 1.
Anyone know a string count function?
Thanks.
EDIT:
new problem, I can't actualy do anything with the user i.e. $1... I want to do something like this:
$DNresult = mysql_query("select displayname from Profile where username = $1 limit 1");
$DNrow= mysql_fetch_array($DNresult);
$1 = $DNrow['displayname'];
this just returns warnings because of the $1, is there any way of turning $1 into a proper/usable variable?
Thanks.