exfriend/uncurl

Unfurl links in PHP

1.0.5 2019-04-14 18:44 UTC

This package is auto-updated.

Last update: 2024-11-15 07:39:22 UTC


README

This package unwraps urls like t.co or bit.ly to actual destination urls by doing an HTTP request and remembering the redirect chain.

Installation

You can install the package via composer:

composer require exfriend/uncurl

Usage

Get the whole chain:

unfurl('http://google.com')->all();
// returns [ 'https://google.com', 'https://www.google.com' ];

Get the final destination:

unfurl('http://google.com')->last();
// returns 'https://www.google.com';

(string) unfurl('http://google.com')
// same as above

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email vlad@serpentine.io instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.