guys i have arrays in which i have to match this kind of text then remove spaces in-between the words ,
Name:'lofse erbbnwq qweqw-qweqw' KKK
Name:'lofsdsse erbsdsdbnwq sds sdsd sdqwsdseqw-qwsdseqw' KKK
Name:'lofsse esdsdbnwq sds sds sddseqw-qwseqw' KKK
i read somewhere that it will work like this, but i tried and its not working :(
$data = preg_replace_callback('%Name:\'(.*)\' kkk%',replace_within_tag, $data);
function replace_within_tag($groups) {return preg_replace('/\s/', '.', $groups[0]);}
output should be like this
Name:'lofse.erbbnwq.qweqw-qweqw' KKK
Name:'lofsdsse.erbsdsdbnwq.sds.sdsd.sdqwsdseqw-qwsdseqw' KKK
Name:'lofsse.esdsdbnwq.sds.sds.sddseqw-qwseqw' KKK
please i need some quick help on this, just tell me the working way