Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function fputcsv_custom1($fp, $array, $eol)
- {
- fputcsv($fp, $array, ';');
- if ("rn" != $eol && fseek($fp, -1, SEEK_CUR) === 0)
- { fwrite($fp, $eol . "rn"); }
- }
- $peoples = OnlineSz::all()->toArray();
- $file = fopen("online_hotel.csv", "w+");
- $file1 = fopen("online_hotel.txt", "w+");
- array_keys($peoples);
- foreach ($peoples as $key => $array) {
- $this->fputcsv_custom($file, $array, ';');
- $this->fputcsv_custom1($file1, $array, ';');
- }
- fclose($file);
- fclose($file1);
- 53;"New test";Worker;test;test;4000;test;test;06123456789;test;0;0;CC;;0;0;
- $this->fputcsv_custom($file4, str_ireplace(chr(32), '/',$user), ';');
- $this->fputcsv_custom1($file5, str_ireplace(chr(32), '/',$user), ';');
- 53;New/test;Alkalmazott;test;test;4000;test;test;06123456789;0;0;CC;0;0;
- $var = str_ireplace('"', '', $var); //strip quotes from $var
- $this->fputcsv_custom($file, str_ireplace('"', '',$array), ';');
- $this->fputcsv_custom1($file1, str_ireplace('"', '',$array), ';');
- $this->fputcsv_custom($file, trim(str_ireplace('"', '',$array)), ';');
- $this->fputcsv_custom1($file1, trim(str_ireplace('"', '',$array)), ';');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement