N
N
Nikita2016-05-27 17:06:29
Facebook
Nikita, 2016-05-27 17:06:29

How to auto-close "https://url" in a tag?

The site has a stream of community events from facebook.
There are registration links in the description of a certain event. How can I make sure that the links in this description are folded into a tag on the site ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2017-01-19
@z4d0r

str_replace(array("\r\n", "\n", "\r"),'
', preg_replace('#((http||https)?://(\S)+[\.]( \S)*[^\s.,> )\];\'\"!?])#is', " \\1 ", $message) , where $message is text containing elements containing "http || https".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question