Reply to Re: [PHP] Count and Preg_Replace Using Version 4.4.1

Your name:

Reply:


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?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация