diff options
Diffstat (limited to 'php')
-rw-r--r-- | php/lib/csv.php | 18 | ||||
-rw-r--r-- | php/lib/util.php | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/php/lib/csv.php b/php/lib/csv.php index 12dff67..832866f 100644 --- a/php/lib/csv.php +++ b/php/lib/csv.php @@ -166,7 +166,7 @@ function csv_csv_to_array($string) { $return = array(); $length = strlen($string); - + // create a temp file and write the string to it $tmpfname = tempnam('/tmp', 'csvlib'); $fh = fopen($tmpfname, 'w'); @@ -194,23 +194,23 @@ function csv_csv_to_array($string) * @param string $enclosure enclosure character, default to '"' * @return &array the two dimensional array with the csv file content, or an empty if an error occured */ -function &csv_csv_file_to_array($filepath, $delimiter=',', $enclosure='"') +function csv_csv_file_to_array($filepath, $delimiter=',', $enclosure='"') { $return = array(); - + if (!file_exists($filepath) || !is_readable($filepath)) return $return; - - $fh =& fopen($filepath, 'r'); + + $fh = fopen($filepath, 'r'); $size = filesize($filepath)+1; - while ($data =& fgetcsv($fh, $size, $delimiter, $enclosure)) + while ($data = fgetcsv($fh, $size, $delimiter, $enclosure)) { $return[] = $data; } - + fclose($fh); - + return $return; } -?> + diff --git a/php/lib/util.php b/php/lib/util.php index fa95114..c058e2d 100644 --- a/php/lib/util.php +++ b/php/lib/util.php @@ -311,9 +311,9 @@ function array_order_by(&$array, $key=null, $order=null, $retain_keys=TRUE, $cas foreach($x as $row_key => $uselessvalue) { if ($retain_keys) - $return_arr[$row_key] =& $array[$row_key]; + $return_arr[$row_key] = $array[$row_key]; else - $return_arr[] =& $array[$row_key]; + $return_arr[] = $array[$row_key]; } return $return_arr; |