Skip to content

Instantly share code, notes, and snippets.

View mtio's full-sized avatar
📍
pull it push it branch it fork it ... technology

Chris mtio

📍
pull it push it branch it fork it ... technology
View GitHub Profile
@mtio
mtio / rank.php
Created April 20, 2016 19:06
Getting a condensed array associated by a key term and making it an index-able array. Sorting that array by a specified key. Also start of a removeOutliers function.
protected function removeOutliers($terms)
{
$dataToCheck = ['searchVolume'];
$sorted = $this->sortTerms($terms, 'searchVolume');
foreach($dataToCheck as $dataTerm) {
$house = [];
$mean = 0;
foreach($sorted as $data) {
array_push($house, $data[$dataTerm]);
$mean += $data[$dataTerm];