Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$str = '<p>this <a href="https://api.slack.com/apps/" target="_blank">link</a> and
the <a href="https://www.google.com" target="_blank">link 2</a></p>';
$reg = '/<a.*href="([^"]+)"[^>]+>(.+)<\/a>/';
preg_match_all($reg, $str, $m);
print_r($m);