I'm creating a page with Hook_menu and I would like to display the user agent that page. This is my code to generate my page.
/**
* Implements hook_menu().
*/
function custom_module_menu() {
$items = array();
$items['custom_module'] = array(
'title' => 'My Custom Module',
'description' => t('Best Custom Module'),
'page callback' => 'custom_module_back',
'access arguments' => array('administer site configuration'),
);
return $items;
}
function custom_module_back(){
$output = array(
'first_para' => array(
'#type' => 'markup',
'#markup' => '<p>Test</p> '
),
);
return $output;
}
I try to set a variable like this $user_agent = $_SERVER['HTTP_USER_AGENT'];
and then call it after the p tag.
Like this
function custom_module_back(){
$output = array(
'first_para' => array(
'#type' => 'markup',
'#markup' => '<p>Test</p> ' $user_agent,
),
);
return $output;
}
And this did not work.
How can I display a variable into a callback ?
'<p>Test</p> ' $user_agent
as valid code.