Note Submitter: mbotta78 at hotmail dot com
----
is it posible to apply user defined function to
replacement?
as sample this works for me:
echo ereg_replace('#([0-9]+)#', '<b>\1<b>' ,
'string_received44');
but i would like to do something like:
echo ereg_replace('#([0-9]+)#', my_function('\1') ,
'string_received44');
function my_function($input){
// this is just sample code,
// this function could be more complex
return 2 * $input;
}
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|