HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

Function eregi_replace() is deprecated in php - How to fix


<< Previous Page
PHP Delete Element
Next Page >>
PHP mysql_query()


Warning - This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.


Example: How to fix.
<?php
function tep_sanitize_string($string)
{
$string = eregi_replace(' +', ' ', trim($string));
return preg_replace("/[<>]/", '_', $string);
}
?>

how to solve it?
Alternatives to this function eregi_replace() use: preg_replace() (with the i (PCRE_CASELESS) modifier)

Example: use preg_replace()
<?php

function tep_sanitize_string($string)
{
$string = preg_replace(' +', ' ', trim($string));
return preg_replace("/[<>]/", '_', $string);
}
?>




<< Previous Page
PHP Delete Element
Next Page >>
PHP mysql_query()



eregi_replace Function eregi_replace() is deprecated in php - How to fix - php tutorial

3214. First script, php tutorial
First script php tutorial
https://www.agernic.com/php-tutorial/first-script.html

3349. PHP Function, Creating PHP Function - how? - example, php tutorial
PHP Function, Creating PHP Function - how? - example php tutorial
https://www.agernic.com/php-tutorial/php-function.html

3354. PHP For Loops
Learn about PHP for loops with this PHP tutorial.
https://www.quackit.com/php/tutorial/php_for_loops.cfm

3364. PHP Summary
Provides a summary to this PHP tutorial.
https://www.quackit.com/php/tutorial/php_summary.cfm

3220. PHP Install, php tutorial
PHP Install php tutorial
https://www.agernic.com/php-tutorial/php-install.html

3351. PHP Arrays
Learn about PHP arrays with this PHP tutorial.
https://www.quackit.com/php/tutorial/php_arrays.cfm

Your add here
PHP strtoupper() function

PHP printf() function

PHP empty() Function

PHP strlen() function

PHP strcmp() function

PHP print() function

PHP strrchr() Function

PHP define() function

PHP str_repeat() function

PHP strstr() function

PHP ucwords() function

PHP similar_text() function

PHP htmlentities() function

PHP count() Function

PHP html_entity_decode() function

PHP str_replace() function

CSS Text Wrap
PHP GET and POST to store data on server
HTML link tag with example
SQL IN Operator - example
PHP String Functions
HTML div class container