fork download
  1. <?php
  2. $ar = array
  3. (
  4. 'Customer' => "xxxx xxxxxxxx",
  5. "Location" => "Edinburgh",
  6. "Description" => "Best xxxx xxxx in the UK by a long distance.
  7.  
  8. Very friendly, would thoroughly recommend to anyone.
  9.  
  10. xx xxxxxxx.",
  11. "Rating" => 5.0
  12. );
  13.  
  14. print_r($ar);
  15. $ar = preg_replace('/[[:space:]]+/', ' ', $ar);
  16. print_r($ar);
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Array
(
    [Customer] => xxxx xxxxxxxx
    [Location] => Edinburgh
    [Description] => Best xxxx xxxx in the UK by a long distance. 

Very friendly, would thoroughly recommend to anyone. 

xx xxxxxxx.
    [Rating] => 5
)
Array
(
    [Customer] => xxxx xxxxxxxx
    [Location] => Edinburgh
    [Description] => Best xxxx xxxx in the UK by a long distance. Very friendly, would thoroughly recommend to anyone. xx xxxxxxx.
    [Rating] => 5
)