-
Here's a better version, actually, as the above doesn't detect the replacement of \n and the like:
function csv_escape($str) {
$replaced_str = str_replace(array('"', ',', "\n", "\r"), array('""', ', ', " \n", " \r"), $str);
if(strcmp($replaced_str,$str)) {
return '"' . $replaced_str . '"';
} else {
return $str;
}
}.
2006-11-30 18:28:21 UTC in IPplan IP address management system
-
The csv_escape function calls str_replace with the count argument, which only exists in PHP5. A PHP3+ compatible version using strcmp follows:
function csv_escape($str) {
$replaced_str = str_replace(array('"', ',', "\n", "\r"), array('""', ',', "\n", "\r"), $str);
if(strcmp($replaced_str,$str)) {
return '"' . $replaced_str . '"';
} else {
return $str;
}...
2006-11-30 18:21:57 UTC in IPplan IP address management system
-
secabeen committed patchset 205 of module cdss to the CD Sharing Server CVS repository, changing 5 files.
2003-10-29 19:44:03 UTC in CD Sharing Server
-
secabeen committed patchset 204 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2003-10-29 19:40:04 UTC in CD Sharing Server
-
secabeen committed patchset 203 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2003-10-29 19:34:59 UTC in CD Sharing Server
-
secabeen committed patchset 202 of module cdss to the CD Sharing Server CVS repository, changing 6 files.
2003-05-17 23:50:54 UTC in CD Sharing Server
-
secabeen committed patchset 201 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2001-03-16 20:58:44 UTC in CD Sharing Server
-
secabeen committed patchset 200 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2001-03-16 20:56:33 UTC in CD Sharing Server
-
secabeen committed patchset 199 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2001-03-16 20:23:11 UTC in CD Sharing Server
-
secabeen committed patchset 198 of module cdss to the CD Sharing Server CVS repository, changing 1 files.
2000-11-08 21:37:30 UTC in CD Sharing Server