You are here: Re: if i wanted to have the text i enter into a database be retrived formated the way i want it how could i do that « PHP Programming Language « IT news, forums, messages
Re: if i wanted to have the text i enter into a database be retrived formated the way i want it how could i do that

Posted by malatestapunk on 11/22/06 07:50

so many sites so little time wrote:
> like can one var = 2 others
> so many sites so little time wrote:
> > one last quick thing can i have lets say $text be something like $a =
> > $b & $c
> > malatestapunk wrote:
> > > Of course, that was from "Mastering Regular Expressions, 2nd Edition",
> > > by Jeffrey E. F. Friedl. It's a great book - definitely a must-read.

I'm not sure I understand - but if jou just want to concatenate two
strings (append one string to the other one), you can do it like this:

$s1 = "bla"; $s2 = "a string";
echo $s1 . $s2; // output: blaa string
// OR
echo "$s1 $s2" // Note: only double quotes here. Output: bla a string

As for the BBCode - it is a specific markup language, where you put
tags in square brackets (as in '[b]...[/b]' for bold, etc) - just like
you have in some forums. It's not HTML. There are ready-made PHP
libraries for conversion of BBCode to HTML - check out PHPClasses, for
example. I guess there are some javascript editors (like the one you
described), but I don't have any experience with them.

There are also some javascript HTML editors, and you can use them
instead of BBCode to get HTML right away (note: you really should do
some xss filtering). I kind of like TinyMC Editor
(http://tinymce.moxiecode.com/), some others prefer FCKEditor
(http://www.fckeditor.net/). There are some others too, so you may want
to do some googling.

But if you consider BBCode, you may also want to look at some other
(IMHO, better) markup alternatives - Textile
(http://jimandlissa.com/project/textilephp) and Markdown
(http://www.michelf.com/projects/php-markdown/). They both have syntax
similar to the one used in Wikis (eg. *bold* for bold, etc), and they
both produce valid (x)HTML. It's basically the same approach as with
BBCode (your users input something that's not HTML, but you use some
PHP code to convert that input into valid HTML), but it's easier to
type and read. No ready-made javascript editors (that I know of) for
these, though.

 

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

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