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
Post a Comment