简体   繁体   中英

Running a PHP file out of the browser

I am running a php file from MATLAB using these commands

url = 'http://www.mathworks.com';
[stat,h] = web(url);
close(h);

I was wonder that is there any possibility to run PHP files without opening browser or running on the browser in some way hidden to the user.

Yes, write your php code in a file:

example.php :

<?php
echo "Hello world"
?>

Then in your MATLAB write:

php_commandline = '"path/to/php/binary" example.php';
[status, result] = system(php_commandline);

I hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM