I have the following form tag
$content = '<form action="link.php" method="post" class="form-inputs">';
$content1 = '<form method="post" class="form-inputs">';
so using my regex code :
preg_replace("~<form\s(.|\n)*?>~i",'<form action="linkafterreplace.php" method="post">', $content);
When I use this code for both $content and $content1 this is what I get:
<form action="linkafterreplace.php" method="post">
and the problem is my code can't get class attributes or id attributes . what I want is :
<form action="linkafterreplace.php" method="post" class="form-inputs">
ps : I'm replacing many urls so every url has its own class attribute so it might not be form-inputs