backward.php
14 years ago
get_taxonomies_by_object_type.php
14 years ago
str_getcsv.php
14 years ago
wp_delete_attachments.php
14 years ago
wp_redirect_or_javascript.php
14 years ago
str_getcsv.php
17 lines
| 1 | <?php |
| 2 | if ( ! function_exists('str_getcsv')): |
| 3 | /** |
| 4 | * str_getcsv function for PHP less than 5.3 |
| 5 | * @see http://php.net/manual/en/function.str-getcsv.php |
| 6 | * NOTE: function doesn't support escape paramter (in correspondance to fgetcsv not supporting it prior 5.3) |
| 7 | */ |
| 8 | function str_getcsv($input, $delimiter=',', $enclosure='"') { |
| 9 | $temp = fopen("php://memory", "rw"); |
| 10 | fwrite($temp, $input); |
| 11 | fseek($temp, 0); |
| 12 | $r = fgetcsv($temp, strlen($input), $delimiter, $enclosure); |
| 13 | fclose($temp); |
| 14 | return $r; |
| 15 | } |
| 16 | |
| 17 | endif; |