By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

mb_eregi_replace

P: n/a
I think that there is a problem using the mb_eregi_replace function.
I've noticed that it doesn't work well when it must replace " bon
chat" for "<b> bon chat</b>" using the next call:

mb_eregi_replace(" bon chat","<b>\\0</b>",$mystring);

Have anybody noticed that? How could I solve it?

Thanks in advance!

Jan 30 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I got this malfunction using PHP Version 5.1.2, but if I use PHP
5.2.0, it works well. Always on Windows Plattform using xampp.

Jan 30 '07 #2

P: n/a
I've a possible solution. You can use some javascript code to replace
all the occurrences with something like this:

myRe2 = new RegExp(' bon chat', 'gi');
document.getElementById('only_context').innerHTML = new
String(document.getElementById('only_context').inn erHTML).replace(myRe2
,'<b>$&</b>');

You must include the text, that you wanna replace into a div called
'only_context' or whatever.

Jan 30 '07 #3

P: n/a
mb_eregi_replace works well on PHP 5.2.0

Feb 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.