calling a php function with exec() -


i trying use exec() run , pass parameters php function named new_array() in array_module.php , expect array return having no luck. using format:

$cmd = exec('cd "c:/wamp/www/test_array" && php array_module.php "'.$input['first'].'"       "'.$input['second'].'" '); 

any appreciated

don't make call through command line file. import other file functions become available , call function directly:

require_once 'c:/wamp/www/test_array/array_module.php';  $result = new_array($input['first'], $input['second']); 

this assumes array_module.php written in sane way can imported elsewhere of course, e.g.:

<?php  function new_array($one, $two) {     ...     return $result; } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -