use NomUrl\NomUrl; $url = NomUrl::createUrl('This is a sample string!'); // Output: 'this-is-a-sample-string' $url2 = NomUrl::createUrl('Another Example #123!'); // Output: 'another-example-123'In the code examples, we see that by using this library, we can easily convert a string into a friendly URL format by calling the createUrl() function of the NomUrl class. Package/library: NomUrl