[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [PHP] Gennegå tekst og tilpasse tags



On Sat, 2 Jul 2005, Anders Ossowicki wrote:

> Jeg har et stykke tekst i en variabel ($body). Denne tekst kan evt. 
> indeholde [b], [/b] tags (tilsvarende for [i], [u] og [url]).
> Jeg ønsker at løbe den tekst igennem, og finde de forekomster hvor der 
> både er et start _og_ slut-tag for derefter at erstatte dem med 
> relevante html-tags.

> Jeg er klar over at strpos og str_replace er noget af det jeg skal

Jeg tror preg_replace er stærkere til at håndterer dette.

Noget ala:
"\[i\](.*)\[/i\]"  "<i>\\1</i>"

> Nogle forslag til hvordan dette problem løses?

Jeg syntes engang jeg har set en funktion der lige præcis kunne dette 
trick i en arbejdsgang, men jeg har helt svedt ud hvad den hed.


-- 
Horsebakken 78, DK-2400 København NV, Phone: +45 2264 8020
----------------------------------------------------------
A: Fordi det ændrer rækkefølgen folk normalt kommunikerer på.
Q: Hvorfor er top-svar en dårlig ting?
A: Top-svar.
Q: Hvad er det mest irriterende i e-mail?


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *