Q:

php calling function in string concatenation

I have problem to calling function in string concatenation 
i have this function :
function  site_url() {
    include("../connect.php");
    $title= mysql_query("select * from shop_option where shop_key='site_url' ");
    $row_title= mysql_fetch_array($title);
    print ''.$row_title['shop_feild'].'';
}

This function will tell website url eg ( http://google.com )
and i want to call this function in string concatenation 
echo '<script language="javascript">'.'window.location =
    "'.site_url().'";'.'</script>';

i also called function into variable ! to testing but it's not work
$page = site_url();
echo '<script language="javascript">'.'window.location = "'.$page.'";'.'</script>';

so how can i call function when i want to string concatenation ?

A:

You need to return the result of site_url rather than printing the text immediately.
function  site_url() {
    include("../connect.php");
    $title= mysql_query("select * from shop_option where shop_key='site_url' ");
    $row_title= mysql_fetch_array($title);
    return $row_title['shop_feild'];
}

