Unflow Export enthaelt keine & mehr

This commit is contained in:
Andreas Österreicher
2010-06-18 10:23:02 +00:00
parent 4f0f8a3abc
commit 1d2d3003e9
2 changed files with 23 additions and 1 deletions
+21
View File
@@ -739,4 +739,25 @@ function isint( $mixed )
return ( preg_match( '/^\d*$/' , $mixed) == 1 );
}
/**
* Multibyte String Replace
*
* @param $needle
* @param $replacement
* @param $haystack
* @return string
*/
function mb_str_replace( $needle, $replacement, $haystack )
{
$needle_len = mb_strlen($needle);
$pos = mb_strpos( $haystack, $needle);
while (!($pos ===false))
{
$front = mb_substr( $haystack, 0, $pos );
$back = mb_substr( $haystack, $pos + $needle_len);
$haystack = $front.$replacement.$back;
$pos = mb_strpos( $haystack, $needle);
}
return $haystack;
}
?>
+2 -1
View File
@@ -26,6 +26,7 @@
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
require_once('../../include/functions.inc.php');
header("Content-Type: text/csv");
header("Content-Disposition: attachment; filename=uniflow.csv");
@@ -62,7 +63,7 @@ if($result = $db->db_query($qry))
{
while($row = $db->db_fetch_object($result))
{
echo "$row->uid;$row->oe_kurzbz;$row->organisationseinheittyp_kurzbz $row->bezeichnung;1\n";
echo mb_str_replace('&','und',"$row->uid;$row->oe_kurzbz;$row->organisationseinheittyp_kurzbz $row->bezeichnung;1\n");
}
}