News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SocialGeek.be:
Clean urls through readable slugs in PHP
January 06, 2009 @ 14:28:16

On the SocialGeek blog there's a recent post that looks at making stubs for your URLs, making them easier to read and remember.

This is where the fun begins of course. How many times have you been confronted with someone sending you an indecipherable, thus untrustworthy link? Right, so we agree that for a user, it is important to have a clean URL that is readable and includes the title of the page or (at least) some description related to the content. Slug time!

They explain what slugs are (and how they're useful for users) as well as how to convert a title into a "slugged" string by replacing anything that's not an A-Z or 0-9 character to remove the less URL friendly characters.

0 comments voice your opinion now!
clean url readable slug tutorial regular expression


Felix Geisendorfer's Blog:
Two Tutorials - Title to Slug & Dependencies with If
October 23, 2006 @ 13:17:58

Over on the ThinkingPHP blog today, there's two new tutorials from Felix Geisendorfer - one dealing with the conversion of WordPress titles into the "slugs" the system uses, and the other the first article he shows a method how, inside the structure of CakePHP, to make a component to grab the slug out of the URL and parse it down to the different parts of the title.

In the second, Felix demonstrates how, with some simple if logic, you can simulate dependencies. His examples include a simple if to check for the return of "true" from various functions and an inline example of an svn export and FTP.

0 comments voice your opinion now!
tutorial title slug dependencies convert tutorial title slug dependencies convert



Community Events





Don't see your event here?
Let us know!


voicesoftheelephpant api introduction language podcast code laravel tips list community release zendserver framework conference symfony deployment interview threedevsandamaybe series bugfix

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework