'; endif; return $img; } function br2nl($string){ $return=eregi_replace('',chr(13).chr(10),$string); return $return; } function RandomizeArray($array){ // error check: $array = (!is_array($array)) ? array($array) : $array; $a = array(); $max = count($array) + 10; while(count($array) > 0){ $e = array_shift($array); $r = rand(0, $max); // find a empty key: while (isset($a[$r])){ $r = rand(0, $max); } $a[$r] = $e; } ksort($a); $a = array_values($a); return $a; } function suf($str, $suf) { $str = explode('.', $str); $ext = '.'.$str[1]; return $str[0].$suf.$ext; } function pre($str, $pre) { $str = explode('/',$str); $c = count($str)-1; $str[$c] = $pre.$str[$c]; $newstr; foreach($str as $piece) { $newstr .= $piece.'/'; } return rtrim($newstr, '/'); } function escape($value) { $return = ''; for($i = 0; $i < strlen($value); ++$i) { $char = $value[$i]; $ord = ord($char); if($char !== "'" && $char !== "\"" && $char !== '\\' && $ord >= 32 && $ord <= 126) $return .= $char; else $return .= '\\x' . dechex($ord); } if(mysql_real_escape_string){ $return = mysql_real_escape_string($return); } return $return; } function emptyDir($path) { // INITIALIZE THE DEBUG STRING $debugStr = ''; $debugStr .= "Deleting Contents Of: $path

"; // PARSE THE FOLDER if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { // IF IT"S A FILE THEN DELETE IT if(is_file($path."/".$file)) { if(unlink($path."/".$file)) { $debugStr .= "Deleted File: ".$file."
"; } } else { // IT IS A DIRECTORY // CRAWL THROUGH THE DIRECTORY AND DELETE IT'S CONTENTS if($handle2 = opendir($path."/".$file)) { while (false !== ($file2 = readdir($handle2))) { if ($file2 != "." && $file2 != "..") { if(unlink($path."/".$file."/".$file2)) { $debugStr .= "Deleted File: $file/$file2
"; } } } } if(rmdir($path."/".$file)) { $debugStr .= "Directory: ".$file."
"; } } } } } return $debugStr; } ?> Van Rooij Interieurbouw <? echo $title ?>