我想插入具有ereg_replace功能的数据给出错误[重复]

This question already has an answer here:

hello i want to use a function of php (ereg_replace) for inserting data into my database but I am receiving this error saying

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\spdealers\Admin Panel\Property_Insert_Page_exe.php on line 3

any one please ???

here is the php code : $propertyid = ereg_replace("[^A-Za-z0-9-]", "", $_POST['propertyid'])

</div>

The question is already available on stackoverflow. Please at least search on Stackoverflow, Please check the below links:-

Function ereg_replace() is deprecated - How to clear this bug?

How to solve the use of deprecated function ereg() of PHP 5.3.0 in Drupal 6.13

Function ereg() is deprecated

switch to preg_replace() , and refer to the below link for the differences http://php.net/reference.pcre.pattern.posix