|
Posted by "Shaun" on 12/04/05 21:00
"comex" <comexk@gmail.com> wrote in message
news:6bf32280512040808s16253e33r6cf972cec52c5a58@mail.gmail.com...
> form'.$count.'...
You can use preg_replace_callback or the e pattern modifier to let you
run php code for the replacement:
http://us3.php.net/manual/en/function.preg-replace-callback.php
http://us3.php.net/manual/en/reference.pcre.pattern.modifiers.php
Hi Comex,
Thanks for your reply, I have modified the code so I have a call back
function:
echo = preg_replace_callback( '/<p[^>]*>(.*?)<\/p>/ms', "callback",
file_get_contents($_GET['file']) );
function callback($matches){
return
'<form name="form" target="_parent"
action="/index.php?action=edit_paragraph&file='.$_GET['file'].'"
method="post">
<input type="hidden" name="old_html"
value="'.htmlentities($matches[0]).'">
<p><a href="javascript:;"
onclick="document.form.submit();">'.$matches[1].'</a></p>
</form>';
}
But I still can't see how I can increment a value in each return string?
Navigation:
[Reply to this message]
|