26738Using Regular Expressions to get HTML tagshttp://tech.hostforadollar.com/index.php?op=articulos&task=verart&aid=6Instead of building a parser that pushes start tags onto a stack and pulls them off once a stop tag is found (if one is found) I find it much easier to use regular expressions. This article is NOT a primer to regular expressions and only shows this particular examplePHP > Tips and Tutorials > Web FetchingOct 16, 2006
If you want to display the actual stock quote on your own site then Yahoo finance pages are a good source. You can select the company you need and visit the URL. We will use this information to fetch the html code of the page and find, cut and paste the necessary part.
Instead of building a parser that pushes start tags onto a stack and pulls them off once a stop tag is found (if one is found) I find it much easier to use regular expressions. This article is NOT a primer to regular expressions and only shows this particular example
This function takes a URL and returns a plain-text version of the page. It uses cURL to retrieve the page and a combination of regular expressions to strip all unwanted whitespace. This function will even strip the text from STYLE and SCRIPT tags, which are ignored by PHP functions such as strip_tags (they strip only the tags, leaving the text in the middle intact).
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.