This class can create and expand short URLs in a custom domain.
It can take a given URL as a parameter and store that URL and a short URL code in a database accessed using PDO.
The class takes a previously initialized PDO object to work with MySQL and other databases supported by PDO.
The class can return the short URL code as part of a short URL of a page that a PHP can serve from a custom domain.
When the user browser accesses the short URL page, the class can return the original long URL, so a script that uses the type can redirect the user browser to the original long URL page.
The class can also track the number of hits the short URL gets by the visitors. |