encoding from .txt file to string using php
I'm doing this project where I receive a .txt file from a MATLAB program in a PHP server. I would like to extract the data in the .txt file and encode it to a string to be sent by t开发者_JAVA技巧he server to an android. Any ideas on how to do that?
Screw the string.
readfile()
use below code for your task.
$file = file_get_contents('test.txt', true);
$parsed_str = json_decode($file);
I think it may be helpful to you..
Thanks.
精彩评论