You are here: ereg_replace « All PHP « IT news, forums, messages
ereg_replace

Posted by shaun.demellweek on 10/13/19 11:31

Hi guys, would appreciate if someone could help me out.

I'm working on a forum script, where a user's text is converted from
code to html.

I have made s start, and most functions are working. The problem I am
having is this:

If a user wants to put text into bold, they place it between
[B]and[/B]. In the last sentence the word and would be in bold. That
works fine. The problem I am having is if a user types it in twice for
example:

[B]I love[/B] php, it is [B]great[/B]!

It is converting it to (in html):

<b>I love[/B] php, it is [B]great</b>!

How can I change my code to make it appear as

<b>I love</b> php, it is <b>great</b>!

The code I am using is:

$itemtochange =
ereg_replace("$from1(.*)$from2","$to1\\1$to2",$itemtochange);

Any ideas?
Many thanks in advance!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация