Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel slug for non-english words too

// Slugs for non-english words too
Laravel str_slug method in order to work with non-english words too. For example chaning ñ to n and ç to c. I always use this method for this kind of conversion:

function slugify($string, $replace = '-')
{
    $removeasci = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
    $removecomas = str_replace(''', '', $removeasci);
    $output = preg_replace('/[^a-zA-Z0-9]/', $replace, $removecomas);

    return strtolower($output);
}
Comment

PREVIOUS NEXT
Code Example
Php :: pagenavi plugin 
Php :: how to get create table query preview in phpmyadmin 
Php :: numeros positivos input laravel 
Php :: onde fica o php ini ubuntu 
Php :: curl_setopt timeout php 
Php :: laravel select error 
Php :: send nested array to laravel resource 
Php :: Laravel retrieving aggregates 
Php :: ph address format 
Php :: how to set db table type in laravel 
Php :: Determine the percentage of the file uploaded to the server using php 
Php :: laravel-filemanager showing blank page 
Php :: undefined function bcmul php linux 
Php :: how to get last 10 digit from number in php 
Php :: laravel get cookie value 
Php :: laravel store mail driver info in database 
Php :: php xpath get all tags under a tag 
Php :: jquery media validation 
Php :: Remove WordPress Login error hints 
Php :: twiml gather php 
Php :: PHP OOP - Static Methods 
Php :: php foreach show only 4 
Php :: quiz 
Php :: laravel filemanger choose multiple images 
Php :: search php array 
Php :: prestashop get product id 
Php :: Select specefied columns from all data in laravel 
Php :: wordpress migrate plugin 
Php :: how to make a timer in php 
Php :: php ajouter += ou =+ 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =