0) { foreach($columns as $column) { echo(",".$column); } echo("\n"); foreach ($rows as $row) { echo($row); foreach ($columns as $column) { if ($content[$row][$column]) { echo(",1"); } else { echo(",0"); } } echo("\n"); } } } /** * Remove unwanted chars from ID * * Cleans a given ID to only use allowed characters. Accented characters are * converted to unaccented ones * * @author Andreas Gohr * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII * @see inc/pageutils.php */ function cleanID($raw_id,$ascii=false){ global $conf; static $sepcharpat = null; global $cache_cleanid; $cache = & $cache_cleanid; // check if it's already in the memory cache if (isset($cache[$raw_id])) { return $cache[$raw_id]; } $sepchar = $conf['sepchar']; if($sepcharpat == null) // build string only once to save clock cycles $sepcharpat = '#\\'.$sepchar.'+#'; $id = trim($raw_id); $id = utf8_strtolower($id); //alternative namespace seperator $id = strtr($id,';',':'); if($conf['useslash']) { $id = strtr($id,'/',':'); }else{ $id = strtr($id,'/',$sepchar); } if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id); if($conf['deaccent'] || $ascii) $id = utf8_deaccent($id,-1); //remove specials $id = utf8_stripspecials($id,$sepchar,'\*'); if($ascii) $id = utf8_strip($id); //clean up $id = preg_replace($sepcharpat,$sepchar,$id); $id = preg_replace('#:+#',':',$id); $id = trim($id,':._-'); $id = preg_replace('#:[:\._\-]+#',':',$id); $cache[$raw_id] = $id; return($id); } /** * returns the full path to the meta file specified by ID and extension * * The filename is URL encoded to protect Unicode chars * * @author Steven Danz * @see inc/pageutils.php */ function metaFN($id,$ext){ global $conf; $id = cleanID($id); $id = str_replace(':','/',$id); $fn = $conf['metadir'].'/'.utf8_encodeFN($id).$ext; return $fn; } ?>