@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | { |
63 | 63 | # First convert associative array to numeric indexed array |
64 | 64 | $workArray = array_values($array); |
65 | - $returnString = ''; # Initialize return string |
|
66 | - $arraySize = count($workArray); # Get size of array |
|
65 | + $returnString = ''; # Initialize return string |
|
66 | + $arraySize = count($workArray); # Get size of array |
|
67 | 67 | |
68 | - for ($i=0; $i<$arraySize; $i++) { |
|
68 | + for ($i = 0; $i < $arraySize; $i++) { |
|
69 | 69 | # Nested array, process nest item |
70 | 70 | if (is_array($workArray[$i])) { |
71 | 71 | $returnString .= $this->str_putcsv($workArray[$i], $delimiter, $enclosure, $terminator); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | switch (gettype($workArray[$i])) { |
74 | 74 | # Manually set some strings |
75 | 75 | case "NULL": $_spFormat = ''; break; |
76 | - case "boolean": $_spFormat = (true == $workArray[$i]) ? 'true': 'false'; break; |
|
76 | + case "boolean": $_spFormat = (true == $workArray[$i]) ? 'true' : 'false'; break; |
|
77 | 77 | # Make sure sprintf has a good datatype to work with |
78 | 78 | case "integer": $_spFormat = '%i'; break; |
79 | 79 | case "double": $_spFormat = '%0.2f'; break; |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | case "resource": |
84 | 84 | default: $_spFormat = ''; |
85 | 85 | } |
86 | - $returnString .= sprintf('%2$s'.$_spFormat.'%2$s', $workArray[$i], $enclosure); |
|
87 | - $returnString .= ($i < ($arraySize-1)) ? $delimiter : $terminator; |
|
86 | + $returnString .= sprintf('%2$s' . $_spFormat . '%2$s', $workArray[$i], $enclosure); |
|
87 | + $returnString .= ($i < ($arraySize - 1)) ? $delimiter : $terminator; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | # Done the workload, return the output information |