Simple Regex to replace all with same amount

albatror

New Member
I cant seem to get this right !I'm trying to replace same amount of spaces with the same amount of other characters:\[code\]$s="abc def f";echo preg_replace('/[\s*]+/', 'X', $s);\[/code\]Expecting abcXXdefXf
 
Back
Top