eregi_replace replacement for php 6?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

eregi_replace replacement for php 6?

Post by pinehead18 »

eregi_replace is being removed in php6 what function should i use?

Thanks,
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: eregi_replace replacement for php 6?

Post by AbraCadaver »

If you need regex then preg_replace(). If not then str_ireplace().

-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Re: eregi_replace replacement for php 6?

Post by pinehead18 »

well, not sure what function i should use. I want to search for a string within a variable that starts with &.
Any thoughts?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: eregi_replace replacement for php 6?

Post by AbraCadaver »

Do you just want to know if the string exists in the other string? Do you want to replace it? Do you want to find something that you're not sure what it is but know what surrounds it or what pattern it is?

-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply