note 38005 added to function.preg-match-all
| From: | chirag at indianic dot com | Date: | Thu, 04 Dec 2003 09:32:46 +0000 |
| Subject: | note 38005 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61383@lists.php.net to get a copy of this message | ||
Here is the problem i am facing
I m trying to extract form tags from the html source
Working example
$form="<form name='test'><input type='text' name='name'
validate='ValidateBlank' ValidMsg='Please Enter Your Name'
php></form>";
preg_match_all( "!<form (.*?)</form>!", $form, $FormTag);
foreach($FormTag[0] as $FromHtml) {
//Loop for all the forms available in html file
preg_match( "!<form (.*?)>!", $FromHtml, $CurrentForm);
$CurrentFormTag=$CurrentForm[0];
echo $CurrentFormTag."<BR>";
}
Above code works fine and gives me "<form name='test'>"
However, same is not working if i press enter, after form tag
like
$form="<form name='test'>
<input type='text' name='name' validate='ValidateBlank'
ValidMsg='Please Enter Your Name' php>
</form>";
Now with above modified string it is not working for me, Please note that i have pressed enter after
form tag
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38005
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38005&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38005&report=yes
Search -- http://master.php.net/manage/user-notes.php