使用PHP PDO执行存储的函数

I have this function stored on my SQL SERVER DATABASE

CREATE FUNCTION [dbo].[fn_md5] (@data VARCHAR(10), @data2 VARCHAR(10))
RETURNS BINARY(16) AS
BEGIN
DECLARE @hash BINARY(16)
EXEC master.dbo.XP_MD5_EncodeKeyVal @data, @data2, @hash OUT
RETURN @hash
END 

To get value that i need i some how to execute like this: [dbo].[fn_md5]('data1','data2') How i do this in php with pdo?

If i use

$exc_line = $db->prepare("exec [dbo].[fn_md5]('data1','data2')");
$exc_line->execute();
$exc_line_data = $exc_line->fetch();

I get no results...

To resolve an issue, lets just compile the answer.

Stored functions executing by SELECT statement. Stored procedures - by EXEC statement, according to docs.

So use this:

SELECT [dbo].[fn_md5]('data1','data2')