Skip to content
Create a gist now

Instantly share code, notes, and snippets.

associative arrays from karma system
$url = '';
$file = file_get_contents($url);
$avail_lines = array();
$pattern = '/^avail\|(.*?)\|(.*?)$/sm';
$repos = array();
$users = array();
preg_match_all($pattern, $file, $avail_lines);
foreach($avail_lines[0] as $i => $line){
$line_users = explode(',', $avail_lines[1][$i]);
$line_repos = explode(',', $avail_lines[2][$i]);
foreach($line_repos as $repo){
$repos[$repo] = array();
foreach($line_users as $user){
foreach($line_repos as $repo){
$repos[$repo][] = $user;
$users[$user][] = $repo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.