This question has already been answered:
- How to find links? 2 answers
Hello. Problem. There is a variable.
$text = 'В нашей строке присутсвуют следующие ссылки: http://snipcode.ru, ftp://php.net и https://google.com'; How to get all references to an array with this variable?
Tried so
preg_match_all('/<a[^>(href=)]+href="http:\/\/(www\.)?hashcode.ru"[^>]+>([A-Za-zА-Яа-я0-9 ]+)<\/a>/isu', $text, $array); print_r($array); As a result, I received an array - Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) )
But something I can’t see from this array what links are there.
I try to look at the link print_r($array[0]); I get Array ( )
Help me figure out php is not strong. What could dig, that I share.