Search
 
SCRIPT & CODE EXAMPLE
 

PHP

slugify text in php

function slugify($text)
    {
        $text = preg_replace('~[^pLd]+~u', '-', $text);
        $text = trim($text, '-');
        $text = strtolower($text);
        //$text = preg_replace('~[^-w]+~', '', $text);
        if (empty($text))
            return 'n-a';
        return $text;
    }
Comment

PREVIOUS NEXT
Code Example
Php :: advantages of php 
Php :: laravel model wherein update 
Php :: convert datetime to string in php 
Php :: php insert array into mysql 
Php :: composer autoload 
Php :: laravel elequent query 
Php :: Number of week days between two dates in php 
Php :: h:i:s explode in php by ":" 
Php :: wp add menu page and subpage 
Php :: jquery code to trigger php function 
Php :: how to give optional parameter in route 
Php :: checkbox options wordpress 
Php :: ci constructor 
Php :: sql update row in php 
Php :: mysqli exception handling 
Php :: drupal 9 guzzle client increase timeout 
Php :: php call constant in class 
Php :: laravel vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36 
Php :: php unit 
Php :: datatable filters 
Php :: replace word in string php 
Php :: php try json decode and check 
Php :: carbon add and subtract 
Php :: force https redirect php s 
Php :: laravel eloquent get fillable 
Php :: Syntax error or access violation: 1071 Specified key was too long; max key length 
Php :: php check year and month is between two dates 
Php :: post data to another page contact form 7 
Php :: merge array in php 
Php :: php authentication 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =