如何在下面的代码中使用$message语句中的函数


how can i use function in $message statement in the following code

假设我有以下php代码,并且我需要在名为$someotherthing的字符串中使用名为any_function的函数,我该如何使用它,请帮助???也可以在$someotherthing中的函数中使用字符串($something)。。。

<?php
function any_function(){
   $something = "something";
}
$someotherthing="need to use the above function here, how can i?";
?>

我需要使用的实际代码如下,我需要在$message 中使用visitor_country()函数

<?php
$fullName=$_REQUEST['fullName'];
$phnNumber=$_REQUEST['phnNumber'];
$enquery=$_REQUEST['enquery'];
$ipaddress = $_SERVER["REMOTE_ADDR"];
function visitor_country()
{
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];
    $result  = "Unknown";
    if(filter_var($client, FILTER_VALIDATE_IP))
    {
        $ip = $client;
    }
    elseif(filter_var($forward, FILTER_VALIDATE_IP))
    {
        $ip = $forward;
    }
    else
    {
        $ip = $remote;
    }
    $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));
    if($ip_data && $ip_data->geoplugin_countryName != null)
    {
        $result = $ip_data->geoplugin_countryName;
    }
    return $result;
}
 $to="digibeem@gmail.com";
   $subject = "Contact Us form Details";
   $message = "'nFull Name : ".$fullName."'n Phone Number:".$phnNumber."'n General Enquiry : ".$enquery."'n IP Address : ".$ipaddress."'n Country: visitor_country() ";
   $from="dbedu@digibeem.com";
    @mail($to,$subject,$message,"From:$from");
    @header("location:../index.php");
?>

只需像其他变量一样添加它:

$message = "'nFull Name : ".$fullName."'n Phone Number:".$phnNumber."'n General Enquiry : ".$enquery."'n IP Address : ".$ipaddress."'n Country: " . visitor_country();