Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello
From php.netCode: Select all
<?php
$string = "April 15, 2003";
$pattern = "/(\w+) (\d+), (\d+)/i";
$replacement = "\${1}1,\$3";
echo preg_replace($pattern, $replacement, $string);
?>There several strings that match with this
Then How can it be replace?
Which one of those strings that match with this $replacement = "\${1}1,\$3"; replace?
there are diffrenetstrings that match with this:$replacement = "\${1}1,\$3
May you explain for me how does this function work by a simple example?
Thanks
Weirdan | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]