$key) { // temp value $about[$key] = ''; // find line if exists if(!isset($contents[$index])) { continue; } $line = $contents[$index]; // skip if not separated by a colon character if(strpos($line, ":") === false) { continue; } $parts = explode(":", $line); // remove the key part array_shift($parts); // in case there was a colon in our value part glue it back together $value = implode('', $parts); $about[$key] = trim($value); } return $about; } }