Hi Stig,
> For example I need: sprintfVariables('This is an example of:
> %name%',array('name'=>'some script'));
> And be able to replace %name% with the variable in the array defined
> with the key 'name'.
That looks like str_replace() would do the trick rather than any
regexp nastiness:
$search = array(
'%name%',
'%address%'
);
$replace = array(
$name,
$address
);
$data = str_replace($search, $replace, $data);
Kind regards,
James McGlinn
__________________________________
CTO
Eventfinder Limited
Suite 106, Heards Building
2 Ruskin Street, Parnell, Auckland 1052
Phone: +649 365 2342
Mobile: +6421 633 234
[EMAIL PROTECTED] | www.eventfinder.co.nz
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---