Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return response()->json(json_decode(file_get_contents('some/path', true)));
- {
- "ID": "123",
- "Date": "08/06/2012",
- "Amount": "�120.59"
- }
- $data = file_get_contents('some/path', true);
- $encoding = mb_detect_encoding($data, mb_detect_order(), true);
- if($encoding !== "UTF-8") {
- return response()->json(json_decode(utf8_decode($data)));
- }
- return response()->json(json_decode($data));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement