/si",$doc,$res); return $res[1]; } function getHTMLelement($doc,$elm){ preg_match("/(.*?)/si",$doc,$res); return $res[0]; } function delHTMLelement($doc,$elm){ $doc=preg_replace('/(.*?)/si','',$doc); return $doc; } function replaceHTMLelement($doc,$elm,$new){ $doc=preg_replace('/(.*?)/si',$new,$doc); return $doc; } function load($filelocation){ if (file_exists($filelocation)){ $newfile = fopen($filelocation,"r"); $file_content = fread($newfile, filesize($filelocation)); fclose($newfile); return $file_content; } } function save($filelocation,$newdatas){ $newfile = @fopen($filelocation,"w+"); @fwrite($newfile, $newdatas); @fclose($newfile); if($newfile!=""){$fileerror=0;} else {$fileerror=1;} return $fileerror; } function untag($string,$tag,$mode){ $tmpval=""; $preg="/<".$tag.">(.*?)<\/".$tag.">/si"; preg_match_all($preg,$string,$tags); foreach ($tags[1] as $tmpcont){ if ($mode==1){$tmpval[]=$tmpcont;} else {$tmpval.=$tmpcont;} } return $tmpval; } function directory($dir,$filters){ $handle=opendir($dir); $files=array(); if ($filters == "all"){while(($file = readdir($handle))!==false){$files[] = $file;}} if ($filters != "all"){ $filters=explode(",",$filters); while (($file = readdir($handle))!==false) { for ($f=0;$f