I have the following custom text and HTML:
$text = "<p>Hello World! Javascript development PHP Developer </p>";
How can I change that text, using regular expressions, into the following:
"<p>Hello World! Javascript development PHP Developer</p>"
Code:
$text = "<p>Hello World! Javascript development PHP Developer </p>";
$result = preg_replace("/( )+/", " ", $text);
echo $result;