<?php
$output = shell_exec(`ip -o -f inet addr show | awk '/scope global/ {print $4}'`);
echo "<pre>$output</pre>";
?>
/var/www/app/src/Controller(/)MyController.php
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{person-id}/',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
$builder
->add('user', ChoiceType::class, [
'label' => false,
'multiple' => true,
'expanded' => true,
'choices' => [
/// вот тут и должен быть массив с вариантами
],
])
foreach ($keys as $key) {
$element = $element[$key] ?? $arr[$key];
}
echo $element['value']