in this thread i was hoping everyone could share thier most use php function with everyone else. mite actually help some people in the future. my most useful one is, that i use so many times i can't count is(it's really 2 but i only split it, becuase in the end it saved me space.):
Code:
function readintostring($filename) {
$final = "";
$file = file($filename);
array_shift($file);
foreach($file as $line) {
$line = trim($line);
$final .= "$line";
}
return $final;
}
function readintomdarray($filename, $safecharacter1, $safecharacter2) {
$mdarray = array();
$file = readintostring($filename);
$temp = explode($safecharacter1, $file);
array_pop($temp);
$length = count($temp);
for ($i = 0; $i < $length; $i++) {
$mdarray[$i] = array();
$temp2 = explode($safecharacter2, $temp[$i]);
$length2 = count($temp2);
for ($i2 = 0; $i2 < $length2; $i2++) {
$mdarray[$i][$i2] = $temp2[$i2];
}
}
return $mdarray;
}