Jump to content

[SOLVED] Remove whitespace


lococobra

Recommended Posts

Okay... another regex problem...

 

Lets say I have the following:

<?php
$input ='foreach($some as $something) echo "ok";';
?>

 

I want to remove all whitespace from that string, but... I don't want to remove the whitespace around "as"

 

How would I get from that $input... using preg_replace... to the following output...

<?php
$output ='foreach($some as $something)echo"ok";';
?>

 

Link to comment
https://forums.phpfreaks.com/topic/59852-solved-remove-whitespace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.