Hi I have the following code but im not a big fun of reg exp as they are too confusing:
<?php
$r = '|\\*(.+)\\*|';
$w = '';
$s = 'hello world *copyMe* here';
function callbk($str){
print_r($str);
foreach($str as $k=>$v) {
echo $v;
}
}
$t = preg_replace_callback($r,'callbk',$s);
//output: Array ( [0] => *copyMe* [1] => copyMe ) *copyMe*copyMe
?>
my question is why is there both "*copyMe*" and "copyMe"? i was hoping to get either one or the other, not both. any help would be appriciated.