$str = "for(var i = 0; i < aLinks.length; i++) {";
preg_replace( "!\s+!", "", $str );
output: for(vari=0;i
My desired output is
for(var i=0;iaLinks.length;i++){
if I remove the arrow like this $str = "for(var i = 0; i (no arrow here) aLinks.length; i++) {";
then I get the desired output.
Why does the back arrow break the regex?
What I want the regex to do is remove all tabs line breaks and spaces and nothing else. the strings may have operators like < or > etc and I want these to be ignored.
preg_replace()
? This seems to work fine: 3v4l.org/TBnOe (output is:for(vari=0;i<aLinks.length;i++){
)<
as the start of an HTML element and doesn't display from that char on