blob: 482882b7173d70e54c8cfc5db53272e1415c2a0c [file] [log] [blame]
<?php
function parseProperties($filename)
{
$properties;
$i = 0;
$handle = fopen($filename, "r");
if ($handle)
{
$size = filesize($filename);
$content = fread($handle, $size);
fclose($handle);
$lineArray = explode("\n",$content);
while(list(,$line) = each($lineArray)) {
$line = trim($line);
if (strlen($line) > 0) {
//echo $line, "<br />";
$propertyPair = explode("=", $line);
$propertyPair[0] = trim($propertyPair[0], " \"\'");
$propertyPair[1] = trim($propertyPair[1], " \"\'");
$properties[$propertyPair[0]] = $propertyPair[1];
$i++;
}
}
}
return $properties;
}
?>