[FX.php List] [OT] Did any of you make a function for parsing links from text fields?

Gjermund Gusland Thorsen ggt667 at gmail.com
Fri Jan 30 06:06:00 MST 2009


What I typed was just a snippet of pseudo code that came to my mind,
might be from a forum habbit...

gtt

2009/1/30 Leo R. Lundgren <leo at finalresort.org>:
> Here's one code snippet, as simple as it can be. If you want more features
> it needs to be modified (for example allow empty urls/texts, or
> validate/restrict invalid syntax).
>
> $a = '[url=www.google.com]Search[/url]';
> $b = preg_replace('/\[url=([^\]]+)\]([^\[]+)\[\/url\]/', '<a
> href="$1">$2</a>', $a);
> print($b);
>
> Is that syntax from FileMaker? It looks like BBcode as well. If FileMaker
> uses the same syntax maybe you can use parts of a BBcode library. Just a
> thought.
>
>
> 30 jan 2009 kl. 13.45 skrev Gjermund Gusland Thorsen:
>
>> [url=www.google.com]Search[/url] or similar?
>> Should of course translate to something like <a
>> href="http://www.google.com">Search</a>
>>
>> ggt667
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> -|
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list