mb_eregi_replace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?iso-8859-1?B?RnJhbiBHYXJj7WE=?=

    mb_eregi_replace

    I think that there is a problem using the mb_eregi_replac e 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_replac e("à bon chat","<b>\\0</b>",$mystring) ;

    Have anybody noticed that? How could I solve it?

    Thanks in advance!

  • =?iso-8859-1?B?RnJhbiBHYXJj7WE=?=

    #2
    Re: mb_eregi_replac e

    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.

    Comment

    • =?iso-8859-1?B?RnJhbiBHYXJj7WE=?=

      #3
      Re: mb_eregi_replac e

      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.getEle mentById('only_ context').inner HTML = new
      String(document .getElementById ('only_context' ).innerHTML).re place(myRe2
      ,'<b>$&</b>');

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

      Comment

      • =?iso-8859-1?B?RnJhbiBHYXJj7WE=?=

        #4
        Re: mb_eregi_replac e

        mb_eregi_replac e works well on PHP 5.2.0

        Comment

        Working...