Re: How to pick out some text for use in a Forum?
- From: gardnern <nathan@xxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 10:40:22 -0700 (PDT)
On Jul 29, 12:10 pm, 703designs <thomasmal...@xxxxxxxxx> wrote:
I'm writing an extension for some PHP forum software. $String is the
post contents, and I want to do the following to it. Note that I'm not
looking for someone to solve this for me, I'm just not sure what the
best approach is.
1. Find all instances of [code]user post text...[/code]
2. If the lang attribute is supplied, keep track of its value for that
code block, e.g. [code lang="css"]
3. Wrap the contents of the code block in HTML tags with the CSS class
set to lang's value if it was specified
4. Of course, output this new string in the same position as before in
the post
Any ideas? Thanks!
the best way to do it is to use regular expressions to find the "lang"
as well as any text inside the [code][/code] tags.
.
- Prev by Date: phpmyadmin configuration
- Next by Date: Re: Should a class directly reference $_SESSION?
- Previous by thread: phpmyadmin configuration
- Next by thread: PDO on windows
- Index(es):
Relevant Pages
|