I want to know if it is possible to check if a textbox contains any link. And if it is possible to select that link out of the field.
I tried it like this, but the problem is that i can't select the whole link and the query is very imprecise.
$a = 'Lorem ipsum dolor sit amet, consetetur sadipscing www.loremipsum.com/asd/fgh/jkl elitr, sed diam ';
if (strpos($a, 'www.') !== false) {
echo 'true';
}
So again for explanation:
I have a text field which can contain a comment but also links. I need to select the correct link out of this field and safe it seperatly in a variable.
I don't want you to code my code but it would be great if anyone know a function or a method to realize this.
Thank you!