mysql_real_escape_string alternative in sc9

Hello, In the SC8 version, to a blank application, I used $vl = mysql_real_escape_string(utf8_encode (trim($_POST [‘vl’])); and allowed me to save any text in a mysql text field. I have upgraded to SC9 and now with php7 this function is obsolete. What can I do to achieve the same effect on SC9? Thanks