Pass BASH associative arrays to PHP script
问题 Is it possible to pass BASH associative arrays as argv to PHP scripts? I have a bash script, that collects some variables to a bash associative array like this. After that, I need to send it to PHP script: typeset -A DATA DATA[foo]=$(some_bash_function "param1" "param2") DATA[bar]=$(some_other_bash_function) php script.php --data ${DATA[@]} From PHP script, i need to access the array in following manner: <?php $vars = getopt("",array( "data:" )); $data = $vars['data']; foreach ($data as $k=>