473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

mb_eregi_replace

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
3 1791
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
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
mb_eregi_replace works well on PHP 5.2.0

Feb 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter.Laganis | last post by:
Hi to all, I apologize in advance if a similar question was already posted, but I didn't find it. Here is my problem: I would like to replace all the special characters ' ¾' with another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.