Re: finding tags and extracting information
| From: | Daniel Adams | Date: | Fri, 10 Aug 2001 20:29:42 +0000 |
| Subject: | Re: finding tags and extracting information | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62214@lists.php.net to get a copy of this message | ||
just put test.php and test.txt in the same directory and run the script.
You should see this output:
Array
(
[0] => Array
(
[0] => href="experience.htm"
[1] => href="quotation.htm"
)
[1] => Array
(
[0] => experience.htm
[1] => quotation.htm
)
)
I hope this helps. :-)
- Dan
On Fri, 10 Aug 2001, David Ovens wrote:
> <td><font color="#FFFFFF" face="Arial Black">|
> </font><font
> face="Arial Black">Home</font></td>
> <td><font color="#FFFFFF" face="Arial Black">|
> </font><a
> href="experience.htm"><font face="Arial
> Black">Experience</font></a></td>
> <td><font color="#FFFFFF" face="Arial Black">|
> </font><a
> href="quotation.htm"><font
> face="Arial Black">Quotation</font></a></td>
> <td align="right" width="1"><img
> src="graphic1.gif"
> width="8" height="27"></td>
>
> I am trying to find the tag "<a href=" for example and extract the reference
> "experience.htm" and "quotation.htm"
>
> Thanks for your help on this as I am struggling to get my head round this one.
>
>
> Dave
>
>
>
>
> ----- Original Message -----
> From: "Daniel Adams" <danno@wpi.edu>
> To: "David Ovens" <DOvens@doweb.co.uk>
> Cc: "Php-General" <php-general@lists.php.net>
> Sent: Friday, August 10, 2001 8:53 PM
> Subject: Re: [PHP] finding tags and extracting information
>
>
> > Send me some of the html and tell me what tag and variable you want to
> > extract.
> >
> > On Fri, 10 Aug 2001, David Ovens wrote:
> >
> > > If I could match the expression, how do I extract the variable after the
> > > expression I have found ?
> > >
> > > ----- Original Message -----
> > > From: "Daniel Adams" <danno@wpi.edu>
> > > To: "David Ovens" <DOvens@doweb.co.uk>
> > > Cc: "Php-General" <php-general@lists.php.net>
> > > Sent: Friday, August 10, 2001 8:22 PM
> > > Subject: Re: [PHP] finding tags and extracting information
> > >
> > >
> > > > Sounds like a job for regular expressions. :-) check out preg_match in
> > > > the docs.
> > > > - Dan
> > > >
> > > > On Fri, 10 Aug 2001, David Ovens wrote:
> > > >
> > > > > I have a string full of html information, and I am trying to find a way
> > > of
> > > > > scanning the string to find a tag and extract a variable from the tag,
> > > but
> > > > > cannot find any functions to split the string in lengths of the tag to
> > > find
> > > > > the variable.
> > > > >
> > > > > so is there a function that will chop x amount of characters from the
> > > left
> > > > > and right of a string so that I can check for information.
> > > > >
> > > > > Hope this is clear
> > > > >
> > > > >
> > > > > Dave
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > --
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-general-help@lists.php.net
> > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> > > >
> > >
> > >
> >
> > --
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
--