AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

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

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Home
PHP Introduction
PHP Install
PHP Syntax
PHP Variables
PHP Echo and Print
PHP Data Types
PHP String Function
PHP Constants
PHP Operator Types
PHP If Else and Elseif
PHP Switch
PHP While Loops
PHP Loop For Do Foreach
PHP Array
Convert Array to String
PHP Function
PHP GET and POST
PHP Date/Time Functions
PHP Login
PHP Delete Element
PHP eregi_replace()
PHP mysql_query()
PHP Errors to Display
PHP Loop For Do Foreach

PHP forms
PHP Form Example
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Upload Image, display, edit and delete i...
Login Form with Image background...
How to Create an Image with Transparent ...
Portfolio Gallery Website with filtering...
Simple pagination script PHP MySQLi...
Center Image in div...
Image Hover Overlay Fade...
Sticky image / element / div on scroll...
Responsive images...
Create rounded image in HTML CSS...
Add border around image...
Position Text Over an Image HTML CSS res...
Create a Slideshow Images Gallery...
Create a Sticky Sidebar...
Search bar using CSS HTML...
Shrink Navigation Menu on Scroll...
How to Create Accordion HTML Templates...
Dropdown menu in the navigation bar...
Responsive Top Navigation Bar with mobil...
Split horizontal navigation bar...