Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function get()
- {
- $data = file_get_contents(__DIR__.'/div.csv');
- $data = explode("\r", $data);
- return $data;
- }
- #Тут вернётся массив для проверки файл скину в ЛС, из которого читаю
- public function parse(): array
- {
- $result = array();
- $parses = $this->get();
- foreach ($parses as $pars) {
- $pars = explode(';', $pars);
- $result[] = [
- 'ticker' => $pars[0],
- 'date_pay' => $pars[1],
- 'amount' => $pars[2],
- 'date_ex' => $pars[3],
- ];
- }
- return $result;
- }
- private function getAllDiv()
- {
- $result = $this->divGateway->parse();
- $response['status_code_header'] = 'HTTP/1.1 200 OK';
- $response['body'] = json_encode($result, JSON_THROW_ON_ERROR);
- return $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement