Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Turn a php string into bbc code

Aloittaja bobdole2281, syyskuu 27, 2013, 01:47:26 IP

« edellinen - seuraava »

bobdole2281

Hello everyone,

I am trying to turn a string from php that I am echoing into bbc code. Meaning, I want it to display as bbc code, here is an example:

echo "[-url=http://google.com]Google link[/url-]"; (No hyphens)

This will display as: [-url=http://google.com]Google link[/url-]

I want it to display as: Google Link

Is their any command I can wrap around this or use. Thanks!!

Arantor

Well, parse_bbc is the bbc parser, but it expects a properly formatted string being given to it. As usual, not enough details for us to be able to help you (do you already have a properly formatted and known safe string? should smileys be parsed? is this user submitted or preset? do all bbc tags have to be used or only a specific subset?)
Holder of controversial views, all of which my own.


bobdole2281

That worked. Thanks! I forgot what the function looked like.

Advertisement: