Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

474
Views
Clean urls - When I use a dash for a space, what should I use for dash?

I have a page that creates a link (clean url) to an article

weburl.com/Title-article

A RewriteRule in .htaccess then rewrites the url to

weburl.com/articles.php?title=Title-article

On articles.php I'm displaying the title after SQL security checks and changing the dash into a whitespace.

$title_dashed = trim_strip_data($_GET['title']); //trim_strip_data() is a custom function that strips unnecessary characters like backslashes and extra white space.
$title = preg_replace("/[-]/", " ", $title_dashed);
echo "$title";

This all works fine but what should I do / use when I have a dash in the title (fe. "T-shirts") and I want that dash to be displayed and not to be removed from the title?

Titles can be user generated and I don't want to restrict dashes in the title.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!