Jump to content

Spaces


Kryptix

Recommended Posts

You could do something like this that I found using google.

 

<?
$str = "This   is  just          some     text";

// use two spaces for the seperator
while (sizeof ($array=explode ("  ",$str)) != 1)
{
  // use one space for the glue
  $str = implode (" ",$array);
}

echo $str;
?>

 

hope that helps.

Link to comment
https://forums.phpfreaks.com/topic/187657-spaces/#findComment-990727
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.