我正在尝试将数组'status'设置为函数结果
const MainDrawer = DrawerNavigator({
OtherDrawer: DrawerNavigator({
AccountScreen: { screen: AccountScreen }
}, getDrawerConfig(300, 'right', 'MainScreen')),
MenuScreen: { screen: MenuScreen }
}, getDrawerConfig(300, 'left', 'MainScreen'));
export default MainDrawer;
我需要数组'status'为“#php,#html” 尝试了很多与“和”的组合,但没有任何成功 我在这里缺少什么,有人帮助我吗?
答案 0 :(得分:1)
您可以从结果中看到,您使用GetTags()
函数获得了echo
#php, #html
return
status
{这不会返回任何内容值中的字符串)。您需要做的是function GetTags() {
echo "#php, #html";
}
$params = array(
'status' =>GetTags()
);
print_r ($params);
来自函数的内容,因此它将被添加为status
'值。
你的方式:
return
结果
#php,#htmlArray([status] =>)
注意文本首次打印在屏幕上,然后echo
中没有值?
现在,function GetTags() {
return "#php, #html";
}
$params = array(
'status' =>GetTags()
);
print_r ($params);
而不是plink -ssh -pw password -batch root@ip "ping -w 1 -c 1 server | grep -oP '\d+(?=% packet loss)' > test.txt"
ing:
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
结果
数组([status] => #php,#html)