kopia lustrzana https://github.com/magicbug/Cloudlog
Added the ablity to search the contesting master scp database.
rodzic
eafae062e5
commit
933ff98979
|
@ -0,0 +1,35 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|
||||
Data lookup functions used within Cloudlog
|
||||
|
||||
*/
|
||||
|
||||
class Lookup extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function scp($string) {
|
||||
$file = 'updates/masterscp.txt';
|
||||
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
|
||||
$input = preg_quote($string, '~');
|
||||
|
||||
$result = preg_grep('~' . $input . '~', $lines, 0);
|
||||
|
||||
$copy = $result;
|
||||
foreach ($result as &$value) {
|
||||
echo $value;
|
||||
|
||||
if (next($copy )) {
|
||||
echo ', '; // Add comma for all elements instead of last
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue