Blog

How to Write a URL Shortener Script with PHP

A URL shortener is a useful script to develop and it's pretty easy if you're familiar with PHP. URL shorteners are being used more now than ever because people need to post short links on Twitter. Long links can sometimes take up the entire 140 character limit Twitter imposes on each 'tweet'. So, the solution is to shrink a long URL into a short one.

Also, it's possible to let people register on your website so they can manage all their URLs, tracking hits, visitor locations and more.

The following code is pretty straight forward for beginner PHP developers, but feel free to contact us if you have any questions or run into any problems with the script. Click here to view the demo and the source code