preg_replace('/\\s+/', ' ',$data) used to Replace new lines, tabs and multiple spaces with single space in PHP
example:
<?php
$data = 'Hi tab i am
new line more spaces';
$data= preg_replace('/\\s+/', ' ',$data);
echo $data;
?>
Output:
Hi tab i am new line more spaces
No comments:
Post a Comment