开发者

encoding from .txt file to string using php

开发者 https://www.devze.com 2023-02-28 23:11 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消