A difficult preg_replace
Posted: Sat Nov 24, 2007 10:37 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
$daily_string contains date substrings such as 11-23-2007
monday() is a function which takes a date substring as its sole parameter and returns a string.
The following code does not work, just to demonstrate what I wish to do. Any helps appreciated.Code: Select all
$daily_string = preg_replace('/(\d\d-\d\d-\d{4})/', monday($1), $daily_string);feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]