Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3754532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:33:34+00:00 2026-05-19T09:33:34+00:00

what is the best preg_replace to create an SEOed text to be used in

  • 0

what is the best preg_replace to create an SEOed text to be used in uri ??

i mean like if we had this uri http://t.com/SOME RANDOM $#@ TEXT _ + ?/ =\ , what is best preg_replace expression to clean it up ?

Thank you .

EDIT : assuming you have multiple languages in the random text language ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:33:34+00:00Added an answer on May 19, 2026 at 9:33 am

    Do you mean a slug?

    Slug('SOME RANDOM $#@ TEXT _ + ?/ =\\'); // some-random-text
    

    For that this should be enough:

    function Slug($string, $slug = '-')
    {
        return strtolower(trim(preg_replace('~[^0-9a-z]+~i', $slug, $string), $slug));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what is the best way to replace a string like this using preg_replace: <a
imagine this url: http://www.youtube.com/watch?v=6n8PGnc_cV4&feature=rec-LGOUT-real_rn-2r-13-HM what is the cleanest and best regexp to do the
I need advice on this snippet $text = preg_replace('|(A.*)?A(.*)C|', '$1foo$2bar', $text); This will match
I was reading http://github.github.com/github-flavored-markdown/ I would like to implement that Newline modification in PHP
Best to describe this in code... I have this public class A<T> { public
Best explained with code I think, this is just a simple example: public class
Best Guess: method - def(self, maybeSomeVariables); lines of code which achieve some purpose Function
just wondering what's the best approach for template String replace. preg_replace('/{%(\S+)%}/', 'bill', $tableOutput); With
So I have this code: $sURLRegExp = '/http\:\/\/([a-z0-9\-\.]+\.[a-z]{2,3}(\/\S*)?)/i'; $iURLMatches = preg_match($sURLRegExp, $sMessage, $aURLMatches); if
I'm looking to create a URL string like the one SO uses for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.