What is a slug ?
A slug is a part of a URL which identifies a particular page on a website in a form readable by users. It’s the nice part of the URL, which explains the page’s content. In WordPress, it’s the editable part of your URL that you can edit when writing a new post.
nSlug allows to create those urls for any language easily.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
use NSlug\SlugGenerator; $options = [ 'limit' => null, 'delimiter' => '-', 'lowercase' => true, ]; $slugGenerator = new SlugGenerator($options); // English strings. echo $slugGenerator->generate('Hello World'); // Prints 'hello-world'. echo $slugGenerator->generate('Life is too short!'); // Prints 'life-is-too-short'. // Arabic strings. echo $slugGenerator->generate('صباح جميل'); // Prints 'صباح-جميل'. echo $slugGenerator->generate('مساء الخير'); // Prints 'مساء-الخير'. |
I am a full-stack developer. My expertise include:
I love programming, design and know my way around server architecture as well. I would never feel complete, with one of these missing.
I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest.
Apart from that, I am a peace loving guy who tries to have people around him that think the same. I truly believe in the principle: “If you help someone, someone will help you, when you need it."