[Seemingly challenging] How does shell obtain the return value in php? for example, the php file returns an array & nbsp; PHPcode & lt ;? Phpreturnarray (a & gt; 1, B & gt; 2, c & gt; public, d & gt;, e & gt ;,);? & Gt; in she [seemingly challenging] How does shell get the return value in php?
The php file returns an array.
PHP code
'1', 'b' => '2', 'c' => 'public', 'd' => '', 'e' => '',);?>
How can I receive this array in shell?
------ Solution --------------------
PHP code
[User: root Time: 07: 23: 08 Path:/home/liangdong/php] $ php. php Array ([a] => 1 [B] => 2 [c] => public [d] => [e] =>) [User: root Time: 07: 23: 10 Path:/home/liangdong/php] $ cat. php
[User: root Time: 07: 23: 12 Path:/home/liangdong/php] $ cat B. php
'1', 'B' => '2', 'C' => 'public', 'D' => '', 'E' => '',);?>
------ Solution --------------------
Shell is not familiar with it. I guess I will use it later, so I studied one,
PHP code
#! /Bin/basheval 'cat php_data.txt | grep "=>" | tr-d ",> \ '" | xargs-I {} echo {}\; | tr "\ n" 'echo $ {a} echo $ {B} echo $ {c} echo $ {d}
------ Solution --------------------
Cross-language data exchange requires a data structure that can be identified by both parties,
Otherwise it will be meaningless.
If your sample php code has been pre-compiled by zend, or is blocked by Wei shield (you cannot say that it is not a php file)
Then how do you separate the data in shell?