After some trial and error, this is the solution I've found.
sqlsrv_connect does by default a connection pooling, so the connection remains in the application pool.
By default, the sqlsrv_connect() uses connection pooling to improve connection performance. To turn off connection pooling (i.e. force a new connection on each call), set the "ConnectionPooling" option in the $connectionOptions array to 0 (or FALSE). For more information, see » SQLSRV Connection Pooling.
From PHP Manual - sqlsrv_connect
My connection used to be like this
$link = sqlsrv_connect($dbserver, array(
'Database'=>$database,
'UID' => $uid,
'PWD' => $pwd
));
Without the characterset.
Even after I added the characterset to the connection, I still experienced this errors.
This is my connection now.
$link = sqlsrv_connect($dbserver, array(
'Database'=>$database,
'UID' => $uid,
'PWD' => $pwd,
'CharacterSet' => 'UTF-8'
));
After I forced the browser to use UTF-8 by using the meta tags it was saving correctly to the db but displaying incorrectly. This was because I was encoding to UTF-8 twice, I then removed the second encoding when displaying.
After all this I did an IIS Reset to reset the application pool, and forced on the scripts to close the connection after processing like this:
// Close the connection.
sqlsrv_close( $linkEventlogic );
It now works correctly.