how to read php file using matlab ?
6 次查看(过去 30 天)
显示 更早的评论
i tried using "urlread" ,which reads the html file .Why not php? . Even i specify php file it returned result which excludes the php code.
0 个评论
采纳的回答
Guillaume
2017-4-7
Your question does not make much sense. PHP is not HTML, it's meant to be interpreted by the web server and tells the server how to create the html it sends to the web client. urlread is a web client so it shouldn't even receive php code. If you give it an html file with embedded php, like all web clients, it does not know what to do with it.
In short, urlread can not, will not, and should not understand php.
3 个评论
Guillaume
2017-4-8
You don't. As said, a PHP script is never read from a web client. It is meaningless to such a client which should never see a PHP script. A PHP script is always executed by the web server.
If you really need to see the html generated by a php script, then you need to install php on your local machine. You could possibly get the script interpreted by the CLI interpreted that's bundled with most PHP install, if the script is very basic. Otherwise, you would also need to install a http server such as Apache, configure said server as the php script expects it, then use your web server to serve the web pages to urlread. This is not a trivial task and if you do it wrong you'll also open your machine to being easily hacked.
Again, php is just a language commonly used to generate web pages. Your question is equivalent to asking how to use urlread to execute some C++ / Fortran / Lisp / etc. code that generates html. It can't do it because it's not its job.
If you post your php script, I could possibly tell you what it does.
Bambos
2021-10-4
@Guillaume hello Sir,
i have a similar case, a web server displaying values using php.
Left you see the web server interface and right is the developer section of chrome browser.
Is there any way to get the electrical values from the right side ?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!