seller-tools / utm-url-parser

UTM URL String Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UTM URL String Parser

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.

About

UTM URL String Parser

License:MIT License


Languages

Language:PHP 100.0%