I have a variable named $text
where it stores texts that the user writes.
'$ text="Hahahha that cool this site, I was able to answer all my questions there link "
'
What do I need?
I have a function named makelink ($ url); which mounts a preview of the content of the link. That is, I need to create a function that will take the FIRST text link and play it in that function, the function will create a preview of the link and will return an output with the HTML result, then of playing the link in the function I need that the output of that goes to the end of the text.
That is:
$textfinal = "Hahahha que legal esse site, consegui responder todas minhas perguntas lá https://pt.stackoverflow.com/" *PREVIA DO LINK*
I see as a good alternative to make a filter with regex or something like that (it's not my area) to be able to capture any type of link ..