convert text file to json php

Solutions on MaxInterview for convert text file to json php by the best coders in the world

showing results for - "convert text file to json php"
Macy
01 Apr 2016
1<?php
2  header('Content-type: application/json');
3  echo json_encode( explode("\r\n",file_get_contents('data.txt')) );
4?>
5