phpの正規表現の質問です。
あるstrデータがあった場合に、特定のurl文字列 + 任意のid(ランダムな文字数)を持ったurlだけを取得する正規表現を知りたいです。
具体的には以下の様な元データがあった場合に、得たいデータの配列の形で取得できる方法をご教授頂ければ幸いです。
#元データ
$text = ' テキストテキストテキスト <a href="https://domain.com/?id=123456890"></a> テキストテキストテキスト <a href="https://domain.com/?id=0112233445"></a> テキストテキストテキスト <a href="https://domain.com/?id=11112223333"></a> テキストテキストテキスト <a href="https://domain.com/?id=111122233334444"></a> ';
##得たいデータ
$urls = array( "https://domain.com/?id=123456890", "https://domain.com/?id=0112233445", "https://domain.com/?id=11112223333", "https://domain.com/?id=111122233334444", );
回答1件
あなたの回答
tips
プレビュー