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 8380273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:24:54+00:00 2026-06-09T16:24:54+00:00

I want to reformat the_title(); the exact same way as WordPress does with the

  • 0

I want to reformat the_title(); the exact same way as WordPress does with the permalinks.

“Borislav Pekić” becomes “borislav-pekic”, “Alberto Méndez” becomes “alberto-mendez” and so on.

<?php
    $forfattare = the_title();
?>

I’ve tried to find the way WordPress does it, but i can’t find it. Thanks in advance.

  • 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-06-09T16:24:55+00:00Added an answer on June 9, 2026 at 4:24 pm

    I use this:

     <?php function createAlias($name)
     {
        setlocale(LC_ALL, 'en_US.UTF8');
        $name = iconv('UTF-8', 'ASCII//TRANSLIT', $name);
        $alias = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $name);
        $alias = strtolower(trim($alias, '-'));
        $alias = preg_replace("/[\/_|+ -]+/", "-", $alias);
    
    
        while (substr($alias, -1, 1) == "-") {
            $alias = substr($alias, 0, -1);
        }
        while (substr($alias, 0, 1) == "-") {
            $alias = substr($alias, 1, 100);
        }
    
        return $alias;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to force IntelliJ to reformat the code the way Eclipse does it.
I have a standard table: I want to use jQuery to reformat the table,
I have XML in the following format which I want to reformat: <blocks> <!--
Is there a way to use regex to reformat a string? I've a string
Does anyone know of a way to get vim to wrap long lines of
Very simple task. I want to reformat a timestamp sent to me from a
I have some well-behaved xml files I want to reformat (NOT PARSE!) using regex.
I want to re-format the digital clock timer. When time is 3:15 (pm), jquery
want to open pdf file when a user clicks on hyperlink shown in gridview
Want to run javascript function from parent window in child window Example I have

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.