Home Forums PHP Convert Multiple Spaces into Single Space using PHP

Viewing 1 post (of 1 total)
  • Author
  • #667
    Usman Haider

    A most common problem while making dynamic URLs is that while converting spaces into dashes using PHP, the multiple consecutive spaces are converted to multiple consecutive dashes, so this effects the SEO negatively. The following code solves this problem very easily:

    The above code converts all the multiple consecutive spaces to a single space. Problem solved 🙂

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.