$text = '<form action="" class="signin" method="post"> <div class="placeholding-input username"> <input type="text" class="text-input email-input" title="Kullanıcı adı veya e-posta adresi" autocomplete="on"> <span class="placeholder">Kullanıcı adı veya e-posta adresi</span> </div> <table class="flex-table password-signin"> <tbody> <tr> <td class="flex-table-primary"> <div class="placeholding-input password flex-table-form"> <input type="password" title="Şifre"> <span class="placeholder">Şifre</span> </div> </td> <td class="flex-table-secondary"> <input type="submit" value="Giriş yap"> </td> </tr> </tbody> </table> <div class="remember-forgot"> <label class="remember"> <input type="checkbox" value="1" name="remember_me"> <span>Beni hatırla</span> </label> <span class="separator">·</span> <a class="forgot" </a> </div> <input type="hidden" name="scribe_log"> <input type="hidden" name="redirect_after_login" value=""> </form>'; preg_match('#<form(.*)</form>#', $text, $array); var_dump($array);