DEMO:





CODE: <form method="POST"> <textarea name="content" style="width: 70%" rows=5> { "img":"https://www.shisha-dreams.de/media/image/f6/75/23/af-queen-1_200x200.jpg.pagespeed.ce.-7B85Xpvml.jpg, https://www.shisha-dreams.de/media/image/9f/9f/a9/af-queen-1_200x200,402x.jpg.pagespeed.ce.HQOLsoRguB.jpg 2x" } </textarea> <br><br> <button type="submit">Extract</button> </form> <?_php if(isset($_POST["content"])){ $pattern = '~[a-z]+://\S+~'; $str = $_POST["content"]; if($num_found = preg_match_all($pattern, $str, $out)){ echo "Es wurden ".$num_found." Links gefunden.<br>"; print_r("Der zweite Link lautet: " . $out[0][1]); } } ?_>
Proudly presented by Thomas <3 At 1 o'clock at night