rhincodon/utm-url-parser

UTM URL String Parser

1.0 2015-08-05 19:58 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:54:05 UTC


README

Build Status

Install

Via Composer

$ composer require rhincodon/utm-url-parser

Usage

    $utmUrl = 'http://test.com/test?utm_source=bing&&utm_medium=cpc&utm_campaign=rolex&utm_term=rolex+two';
    $parser = new \Rhinodontypicus\Parsers\UtmParser();
    $utmString = $parser->parse($utmUrl);
    if ($utmString->isValid()) { // true
        echo $utmString->source; // bing
        echo $utmString->medium; // cpc
        echo $utmString->campaign; // rolex
        echo $utmString->term; // rolex two
    }

Credits

License

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