What are the differences in syntax between calling a stored procedure and a table-valued function in PHP when connecting to a MS SQL Server database?

When calling a stored procedure in PHP to connect to a MS SQL Server database, you use the `EXEC` command followed by the stored procedure name and any parameters. However, when calling a table-valued function, you use a `SELECT` statement with the function name and parameters enclosed in parentheses. Make sure to properly handle any returned data from the stored procedure or function.

// Calling a stored procedure
$procedureName = 'your_stored_procedure_name';
$param1 = 'value1';
$param2 = 'value2';

$sql = "EXEC $procedureName @param1 = ?, @param2 = ?";
$stmt = sqlsrv_query($conn, $sql, array($param1, $param2));

// Calling a table-valued function
$functionName = 'your_table_valued_function_name';
$param1 = 'value1';
$param2 = 'value2';

$sql = "SELECT * FROM $functionName(?, ?)";
$stmt = sqlsrv_query($conn, $sql, array($param1, $param2));