And I thought prepString() was the pinnacle of awesome.
12345678910111213141516171819202122232425262728
<?php/* addslashes_mssql and stripslashes_mssql enable us to read from MS SQL Server (as opposed to other databases, where the PHP built-in functions addslashes() and stripslashes() work for MySQL and others */functionaddslashes_mssql($str){if(is_array($str)){foreach($strAS$id=>$value){$str[$id]=addslashes_mssql($value);}}else{$str=str_replace("'","''",$str);}return$str;}functionstripslashes_mssql($str){if(is_array($str)){foreach($strAS$id=>$value){$str[$id]=stripslashes_mssql($value);}}else{$str=str_replace("''","'",$str);}return$str;}