Skip to content

Instantly share code, notes, and snippets.

@jimrubenstein
Forked from kvncrw/gist:0ddcdf44982a8d16642d
Last active August 29, 2015 14:02

Revisions

  1. jimrubenstein revised this gist Jun 18, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -3,5 +3,5 @@
    $words = explode('_', $metric_info['uid']);
    array_shift($words);

    return implode('', array_map(function('ucfirst', $words)));
    return implode('', array_map('ucfirst', $words));
    };
  2. jimrubenstein revised this gist Jun 18, 2014. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    $generateKpiValue = function($metric_info) {
    // there's a regexp for this, if you know it, it'd probably be faster
    $words = explode('_', str_replace('ga_', '', $metric_info['uid']));
    foreach($words as &$word) {
    $word = ucfirst($word);
    }
    return join('', $words);

    $words = explode('_', $metric_info['uid']);
    array_shift($words);

    return implode('', array_map(function('ucfirst', $words)));
    };
  3. @KCrawley KCrawley created this gist Jun 18, 2014.
    8 changes: 8 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    $generateKpiValue = function($metric_info) {
    // there's a regexp for this, if you know it, it'd probably be faster
    $words = explode('_', str_replace('ga_', '', $metric_info['uid']));
    foreach($words as &$word) {
    $word = ucfirst($word);
    }
    return join('', $words);
    };