Home Forums PHP Convert Multiple Spaces into Single Space using PHP

This topic contains 0 replies, has 1 voice, and was last updated by  Usman Haider 3 years, 2 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #667

    Usman Haider
    Keymaster

    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.