Jump to content

Creating Links using [url]


imperialized

Recommended Posts

A lot of forums use this type of linking system, as to prevent users from inputting html.

 

If I wanted to include something similar in my news posting script, how would I go about this? I am not very fluent with php, I know basics, but when it comes to manipulating strings, etc, I am very new... as you can probably tell with my previous questions.

 

Anyways, to further elaborate and explain my question, I want to know how to make links like so:

 

[link url=http://xxxx](link text goes here)[/link] 

 

Furthermore, what if I wanted to do the same thing with images? Such as:

 

src=xxxxhttp://[/img] 

 

Now, I realize that I will most likely have to do

str_replace("[/img]", "</img>", $string);

 

However, I guess my real question would be how to extract the URLs into variables and place them in the right place. If this is confusing I appologize, but I appreciate any help. Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/94423-creating-links-using-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.