Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
associative arrays from php.net karma system
<?php
$url = 'http://svn.php.net/viewvc/SVNROOT/global_avail?revision=HEAD&view=co';
$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){
if(!isset($repos[$repo])){
$repos[$repo] = array();
}
}
foreach($line_users as $user){
foreach($line_repos as $repo){
$repos[$repo][] = $user;
$users[$user][] = $repo;
}
}
}
var_dump($users);
var_dump($repos);
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.